$darkmode
#include <trigger.hpp>
Public Member Functions | |
| virtual TriggerSchema | schema () const |
| virtual fable::Json | json_schema () const |
| virtual std::unique_ptr< T > | make (const Conf &c) const =0 |
| virtual std::unique_ptr< T > | make (const std::string &s) const |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
Public Member Functions inherited from cloe::Entity | |
| Entity (std::string name) | |
| Entity (std::string name, std::string desc) | |
| const std::string & | name () const |
| void | set_name (std::string name) |
| const std::string & | description () const |
| void | set_description (std::string desc) |
Additional Inherited Members | |
Protected Member Functions inherited from cloe::Entity | |
| virtual Logger | logger () const |
Protected Attributes inherited from cloe::Entity | |
| std::string | name_ |
| std::string | desc_ |
TriggerFactory is a superclass for EventFactory and ActionFactory that also accepts alternate inputs for configuration.
This class should not be used directly; instead, new factories should base off of EventFactory or ActionFactory, which inherit from AlternateFactory.
It extends the Factory interface with the method make(const std::string&); this allows the creation of an event or a factory from a string instead of full JSON object.
The default schema is an implicit one; that is, the factory takes no configuration but can be called with the name only. An inline format is therefore also implicitly supported.
|
inlinevirtual |
Return factory usage.
|
pure virtual |
Create a new T based on the content of the input Conf.
Implemented in cloe::events::TransitionFactory< T >, cloe::actions::SetVariableActionFactory< T >, cloe::actions::PushReleaseFactory, cloe::actions::InsertFactory, cloe::actions::BundleFactory, cloe::actions::LogFactory, cloe::events::EvaluateFactory, cloe::actions::ConfigureFactory, cloe::utility::ContactFactory< D >, vtd::ScpActionFactory, engine::events::NextFactory, engine::events::TimeFactory, engine::actions::CommandFactory, and engine::actions::LuaFactory.
|
inlinevirtual |
Create a new T based on the content of the input string.
The default implementation tries to make an instance with an empty JSON object, which only works for actions and events that require no input.
It is strongly recommended to implement this method by creating a Conf object and passing that to the make(const Conf&) method. This allows users to draw a strong parallel from string representation to JSON representation.
Reimplemented in cloe::events::TransitionFactory< T >, cloe::actions::SetVariableActionFactory< T >, cloe::actions::LogFactory, cloe::events::EvaluateFactory, cloe::utility::ContactFactory< D >, vtd::ScpActionFactory, engine::events::NextFactory, engine::events::TimeFactory, engine::actions::CommandFactory, and engine::actions::LuaFactory.
|
inlinevirtual |
Return factory schema.
This can be used to check input automatically or to derive help text for all trigger events and actions dynamically.
Reimplemented in cloe::events::TransitionFactory< T >, cloe::actions::PushReleaseFactory, cloe::actions::InsertFactory, cloe::actions::BundleFactory, cloe::actions::LogFactory, cloe::events::EvaluateFactory, cloe::actions::ConfigureFactory, cloe::utility::ContactFactory< D >, vtd::ScpActionFactory, engine::events::NextFactory, engine::events::TimeFactory, engine::actions::CommandFactory, and engine::actions::LuaFactory.