$darkmode
cloe::Event Class Referenceabstract

#include <trigger.hpp>

Inheritance diagram for cloe::Event:
Collaboration diagram for cloe::Event:

Public Member Functions

virtual EventPtr clone () const =0
 
virtual void to_json (fable::Json &) const =0
 
 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)
 

Protected Member Functions

Logger logger () const
 

Friends

void to_json (fable::Json &j, const Event &e)
 

Additional Inherited Members

- Protected Attributes inherited from cloe::Entity
std::string name_
 
std::string desc_
 

Detailed Description

Event represents the event/condition portion of a trigger, and is what causes an action to be executed.

It is created through an EventFactory, and registered with the simulation through the Registrar interface.

The primary identifying interface of an Event is through it's constructor, where it receives its name, together with the to_json(fable::Json&) method, where any further state is represented. This allows a new identical Event to be created.

The actual triggering of an Event is achieved through the Callback interface, in which Triggers with the corresponding event are contained.

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

Member Function Documentation

◆ clone()

virtual EventPtr cloe::Event::clone ( ) const
pure virtual

Clone this event with correct state information.

This happens when a sticky trigger evaluates to true.

Implemented in cloe::events::Transition< T >, cloe::events::Evaluate, and engine::events::TimeEvent.

◆ logger()

Logger cloe::Event::logger ( ) const
inlineprotectedvirtual

Return the Logger that the manager should use.

Reimplemented from cloe::Entity.

◆ to_json()

virtual void cloe::Event::to_json ( fable::Json ) const
pure virtual

Describe the event state so that the same event can be re-created through it's JSON representation with the corresponding EventFactory.


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