15#ifndef ROBOLIGO_COMMON_CLASSIFICATION__TRIGGER_HPP_
16#define ROBOLIGO_COMMON_CLASSIFICATION__TRIGGER_HPP_
45 Trigger(std::string name, std::string value, std::vector<Mode> previous, std::vector<Mode> next)
106 std::function<void()>
cb;
std::string get_value(void)
Gets the value of the trigger.
Definition Trigger.cpp:26
bool available_
If trigger is available.
Definition Trigger.hpp:118
std::string value_
Value for the trigger.
Definition Trigger.hpp:112
std::function< void()> cb
Callback function.
Definition Trigger.hpp:106
bool is_available(void)
Checks if the trigger is available for execution.
Definition Trigger.cpp:56
void execute(void)
Executes the trigger and invokes its registered callback.
Definition Trigger.cpp:69
std::vector< Mode > next_
Vector of next modes.
Definition Trigger.hpp:116
std::string name_
Trigger name.
Definition Trigger.hpp:110
void register_callback(const std::function< void()> &callback)
Registers a callback function to be executed when the trigger fires.
Definition Trigger.cpp:62
std::vector< Mode > previous_
Vector of previous modes.
Definition Trigger.hpp:114
std::string get_name(void)
Gets the name of the trigger.
Definition Trigger.cpp:20
void set_value(std::string new_value)
Sets a new value for the trigger.
Definition Trigger.cpp:38
void set_next_modes(std::vector< Mode > modes)
Sets the next modes for this trigger.
Definition Trigger.cpp:50
void set_previous_modes(std::vector< Mode > modes)
Sets the previous modes for this trigger.
Definition Trigger.cpp:44
virtual ~Trigger()=default
Destructor.
Trigger(std::string name, std::string value, std::vector< Mode > previous, std::vector< Mode > next)
Constructor for Trigger.
Definition Trigger.hpp:45
void set_name(std::string new_name)
Sets a new name for the trigger.
Definition Trigger.cpp:32
Definition ClassificationBase.hpp:28