$darkmode
cloe::TriggerFactory< T > Class Template Referenceabstract

#include <trigger.hpp>

Inheritance diagram for cloe::TriggerFactory< T >:
Collaboration diagram for cloe::TriggerFactory< T >:

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_
 

Detailed Description

template<typename T>
class cloe::TriggerFactory< T >

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.

Member Function Documentation

◆ json_schema()

template<typename T >
virtual fable::Json cloe::TriggerFactory< T >::json_schema ( ) const
inlinevirtual

Return factory usage.

Here is the call graph for this function:

◆ make() [1/2]

◆ make() [2/2]

template<typename T >
virtual std::unique_ptr<T> cloe::TriggerFactory< T >::make ( const std::string &  s) const
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.

Here is the call graph for this function:

◆ schema()

template<typename T >
virtual TriggerSchema cloe::TriggerFactory< T >::schema ( ) const
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.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: