$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 <fable/json.hpp>
#include <fable/schema.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::EventPtrs = std::vector< EventPtr >
 
using cloe::ActionPtrs = std::vector< ActionPtr >
 
using cloe::TriggerPtrs = std::vector< TriggerPtr >
 
using cloe::EventFactoryPtr = std::unique_ptr< EventFactory >
 
using cloe::CallbackExecuter = std::function< void(TriggerPtr &&, const Sync &)>
 
using cloe::ActionFactoryPtr = std::unique_ptr< ActionFactory >
 

Enumerations

enum class  cloe::Source {
  FILESYSTEM , NETWORK , MODEL , TRIGGER ,
  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

◆ CallbackExecuter

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

Interface the trigger manager must provide for executing triggers.

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.

Enumerator
FILESYSTEM 

Triggers that originate from the filesystem, such as stack files.

NETWORK 

Triggers that originate from the network API, such as JSON data. It may be useful to disable these to prevent dynamic interactions.

MODEL 

Triggers that originate from models, such as a simulator binding.

TRIGGER 

Triggers that originate from triggers themselves. It may be necessary to disable these to prevent duplicate triggers.

INSTANCE 

Triggers that are instance of a sticky trigger.

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.