$darkmode
trigger.hpp File Reference
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <cloe/core.hpp>
#include <cloe/entity.hpp>
#include <fable/enum.hpp>
Include dependency graph for trigger.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cloe::TriggerError
 
class  cloe::TriggerInvalid
 
struct  cloe::InlineSchema
 
struct  cloe::TriggerSchema
 
class  cloe::TriggerFactory< T >
 
class  cloe::Trigger
 
class  cloe::TriggerRegistrar
 
class  cloe::Event
 
class  cloe::Callback
 
class  cloe::AliasCallback
 
class  cloe::Action
 

Typedefs

using cloe::EventPtr = std::unique_ptr< Event >
 
using cloe::EventPtrs = std::vector< EventPtr >
 
using cloe::ActionPtr = std::unique_ptr< Action >
 
using cloe::ActionPtrs = std::vector< ActionPtr >
 
using cloe::TriggerPtr = std::unique_ptr< Trigger >
 
using cloe::TriggerPtrs = std::vector< TriggerPtr >
 
using cloe::EventFactory = TriggerFactory< Event >
 
using cloe::EventFactoryPtr = std::unique_ptr< EventFactory >
 
using cloe::CallbackExecuter = std::function< void(TriggerPtr &&, const Sync &)>
 
using cloe::ActionFactory = TriggerFactory< Action >
 
using cloe::ActionFactoryPtr = std::unique_ptr< ActionFactory >
 

Enumerations

enum  cloe::Source {
  cloe::Source::FILESYSTEM, cloe::Source::NETWORK, cloe::Source::MODEL, cloe::Source::TRIGGER,
  cloe::Source::INSTANCE
}
 

Functions

 cloe::ENUM_SERIALIZATION (Source,({ {Source::FILESYSTEM, "filesystem"}, {Source::NETWORK, "network"}, {Source::MODEL, "model"}, {Source::TRIGGER, "trigger"}, {Source::INSTANCE, "instance"}, })) inline bool source_is_transient(Source s)
 

Detailed Description

Typedef Documentation

◆ ActionFactory

using cloe::ActionFactory = typedef TriggerFactory<Action>

An ActionFactory parses a single JSON object or string into an action.

See also
cloe/trigger/example_actions.hpp

◆ CallbackExecuter

using cloe::CallbackExecuter = typedef std::function<void(TriggerPtr&&, const Sync&)>

Interface the trigger manager must provide for executing triggers.

◆ EventFactory

using cloe::EventFactory = typedef TriggerFactory<Event>

An EventFactory parses a single JSON object or string into an Event.

See also
cloe/registrar.hpp
cloe/trigger/nil_event.hpp

Enumeration Type Documentation

◆ Source

enum cloe::Source
strong

Source is an enumeration of all possible Trigger origins.

This enables reproducibility by allowing a simulation to ignore triggers with certain sources, for example the web UI. When saving a history of triggers, it also highlights triggers that are generated by other triggers.

Function Documentation

◆ ENUM_SERIALIZATION()

cloe::ENUM_SERIALIZATION ( Source  ,
({ {Source::FILESYSTEM, "filesystem"}, {Source::NETWORK, "network"}, {Source::MODEL, "model"}, {Source::TRIGGER, "trigger"}, {Source::INSTANCE, "instance"},})   
)

Return whether a source is considered transient.

Transient sources are those where the trigger is generated as opposed to originating from the user. This is an important distinction as generated (i.e., transient) triggers should not be re-inserted for simulation reproduction.