ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
Strategy.hpp File Reference
#include <map>
#include <memory>
#include <stdexcept>
#include <string>
#include <nlohmann/json.hpp>

Go to the source code of this file.

Classes

struct  Strategy< Derived >
 CRTP base class providing self-registration for strategy types. More...
 

Macros

#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
 Auto-registration macro for strategy factories.
 

Macro Definition Documentation

◆ PPFOREST2_REGISTER_STRATEGY

#define PPFOREST2_REGISTER_STRATEGY ( StrategyBase,
name )
Value:
inline static const bool registered_ = StrategyBase::register_strategy(name, from_json);

Auto-registration macro for strategy factories.

Registers ConcreteStrategy::from_json as the factory for name in the given StrategyBase class.

Usage (inside the concrete strategy struct, after from_json):

struct PPPDAStrategy : public PPStrategy {
static PPStrategy::Ptr from_json(const nlohmann::json& j);
PPFOREST2_REGISTER_STRATEGY(PPStrategy, "pda")
};
#define PPFOREST2_REGISTER_STRATEGY(StrategyBase, name)
Auto-registration macro for strategy factories.
Definition Strategy.hpp:100