10 #include <unordered_map>
42 StateFactory(
const std::vector<std::string> & paths,
const std::vector<std::string> & files,
bool verbose);
51 void load(
const std::map<std::string, mc_rtc::Configuration> & states);
93 bool hasState(
const std::string & state)
const;
96 const std::vector<std::string> &
states()
const;
111 template<
typename RetT,
typename... Args>
112 void register_object(
const std::string & name, std::function<RetT *(
const Args &...)> callback)
115 states_.push_back(name);
132 return states_configurations_.at(state);
137 StatePtr create(
const std::string & state,
const std::string & final_name);
140 StatePtr create(
const std::string & state,
145 void update(
const std::string & cn);
148 std::vector<std::string> states_;
149 std::unordered_map<std::string, StateConfiguration> states_configurations_;
#define MC_CONTROL_FSM_DLLAPI
Definition: api.h:50
ltdl wrapper for mc_rtc purpose
struct MC_CONTROL_FSM_DLLAPI Controller
Definition: State.h:23
std::shared_ptr< State > StatePtr
Definition: State.h:172
Definition: CompletionCriteria.h:11
struct MC_RTC_UTILS_DLLAPI Configuration
Definition: Configuration.h:46
Definition: Controller.h:50
Definition: StateFactory.h:120
mc_rtc::Configuration config
Definition: StateFactory.h:126
std::string base
Definition: StateFactory.h:122
std::string arg
Definition: StateFactory.h:124
Definition: StateFactory.h:33
void load_libraries(const std::vector< std::string > &paths)
bool hasState(const std::string &state) const
bool load_with_loader(const std::string &state)
StatePtr create(const std::string &state)
StatePtr create(const std::string &state, Controller &ctl, const mc_rtc::Configuration &config)
void register_object(const std::string &name, std::function< RetT *(const Args &...)> callback)
Definition: StateFactory.h:112
const std::vector< std::string > & states() const
void load_files(const std::vector< std::string > &files)
StateFactory(const std::vector< std::string > &paths, const std::vector< std::string > &files, bool verbose)
const StateConfiguration & configuration(const std::string &state) const
Definition: StateFactory.h:130
StatePtr create(const std::string &state, Controller &ctl)
void load(const std::string &name, const std::string &base, const mc_rtc::Configuration &config)
StatePtr create(const std::string &state, const mc_rtc::Configuration &config)
void load(const std::map< std::string, mc_rtc::Configuration > &states)
Simplify access to values hold within a JSON file.
Definition: Configuration.h:166
ltdl wrapper for factory-like classes
Definition: loader.h:187
void register_object(const std::string &name, std::function< RetT *(const Args &...)> callback)