rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
rad::SMAdapter Class Reference

#include <smAdapter.hpp>

Public Member Functions

 SMAdapter (boost::asio::io_service &ios, scxml4cpp::Context *context, scxml4cpp::EventQueue &external_events)
 
virtual ~SMAdapter ()
 
void Load (const std::string &filename, std::list< scxml4cpp::Action * > *action_list, std::list< scxml4cpp::Activity * > *activity_list)
 
void Append (const std::string &filename, std::list< scxml4cpp::Action * > *action_list, std::list< scxml4cpp::Activity * > *activity_list)
 
void Start ()
 
void Stop ()
 
void PostEvent (SharedEvent e)
 
void ProcessEvent ()
 
void ProcessEvent (scxml4cpp::Event *e)
 
void ProcessEvent (const AnyEvent &e)
 
void AddStatusListener (scxml4cpp::StatusListener *listener)
 
void AddEventListener (scxml4cpp::EventListener *listener)
 
void SetLogLevel (const std::string &level)
 
 SMAdapter (const SMAdapter &e)=delete
 
SMAdapteroperator= (SMAdapter &e)=delete
 
 SMAdapter (boost::asio::io_service &ios, scxml4cpp::Context *context, scxml4cpp::EventQueue &external_events)
 
virtual ~SMAdapter ()
 
void Load (const std::string &filename, std::list< scxml4cpp::Action * > *action_list, std::list< scxml4cpp::Activity * > *activity_list)
 
void Append (const std::string &filename, std::list< scxml4cpp::Action * > *action_list, std::list< scxml4cpp::Activity * > *activity_list)
 
void Start ()
 
void Stop ()
 
void PostEvent (SharedEvent e)
 
void ProcessEvent ()
 
void ProcessEvent (scxml4cpp::Event *e)
 
void ProcessEvent (const AnyEvent &e)
 
void AddStatusListener (scxml4cpp::StatusListener *listener)
 
void AddEventListener (scxml4cpp::EventListener *listener)
 
void SetLogLevel (const std::string &level)
 
 SMAdapter (const SMAdapter &e)=delete
 
SMAdapteroperator= (SMAdapter &e)=delete
 

Detailed Description

This is the adapter to the SCXML engine.

Todo:
replace raw pointers with smart pointers.

This is the adapter to the SCXML engine.

Todo:
replace raw pointers with smart pointers.

Constructor & Destructor Documentation

rad::SMAdapter::SMAdapter ( boost::asio::io_service &  ios,
scxml4cpp::Context context,
scxml4cpp::EventQueue external_events 
)
Parameters
[in]iosEvent loop.
[in]contextSCXML context.
[in]external_eventsSCXML external event queue.
rad::SMAdapter::~SMAdapter ( )
virtual

Cleanup before quitting.

rad::SMAdapter::SMAdapter ( const SMAdapter e)
delete
rad::SMAdapter::SMAdapter ( boost::asio::io_service &  ios,
scxml4cpp::Context context,
scxml4cpp::EventQueue external_events 
)
virtual rad::SMAdapter::~SMAdapter ( )
virtual
rad::SMAdapter::SMAdapter ( const SMAdapter e)
delete

Member Function Documentation

void rad::SMAdapter::AddEventListener ( scxml4cpp::EventListener listener)

Register a listener for the event processed notification.

Parameters
[in]listenerListener to be registered.
void rad::SMAdapter::AddEventListener ( scxml4cpp::EventListener listener)
void rad::SMAdapter::AddStatusListener ( scxml4cpp::StatusListener listener)

Register a listener for a change of SM state notification.

Parameters
[in]listenerListener to be registered.
void rad::SMAdapter::AddStatusListener ( scxml4cpp::StatusListener listener)
void rad::SMAdapter::Append ( const std::string &  filename,
std::list< scxml4cpp::Action * > *  action_list,
std::list< scxml4cpp::Activity * > *  activity_list 
)
void rad::SMAdapter::Append ( const std::string &  filename,
std::list< scxml4cpp::Action * > *  action_list,
std::list< scxml4cpp::Activity * > *  activity_list 
)
void rad::SMAdapter::Load ( const std::string &  filename,
std::list< scxml4cpp::Action * > *  action_list,
std::list< scxml4cpp::Activity * > *  activity_list 
)

Load an SCXML model from file.

Parameters
[in]filenameSCXML model to load.
[in]action_listList of actions mapped to SCXML model.
[in]activity_listList of activities mapped to SCXML model.
Returns
0 if the model can be loaded, -1 otherwise.
Todo:
throw exception for ill-formed models?
void rad::SMAdapter::Load ( const std::string &  filename,
std::list< scxml4cpp::Action * > *  action_list,
std::list< scxml4cpp::Activity * > *  activity_list 
)
SMAdapter& rad::SMAdapter::operator= ( SMAdapter e)
delete
SMAdapter& rad::SMAdapter::operator= ( SMAdapter e)
delete
void rad::SMAdapter::PostEvent ( SharedEvent  e)
void rad::SMAdapter::PostEvent ( SharedEvent  e)

Post asynchronously an event, to be processed by the SM, in the Event Loop. Note: this method can be invoked also by passing UniqueEvent as argument since C++ will upgrade it SharedEvent automatically.

Parameters
[in]eShared RAD event to post.
void rad::SMAdapter::ProcessEvent ( )
void rad::SMAdapter::ProcessEvent ( )

Trigger the processing of the events in the SM external event queue.

void rad::SMAdapter::ProcessEvent ( scxml4cpp::Event e)
void rad::SMAdapter::ProcessEvent ( scxml4cpp::Event e)

Trigger the processing of the given event. (the processing terminates when the SM external event queue is empty)

Parameters
[in]eSCXML event to be processed.
void rad::SMAdapter::ProcessEvent ( const AnyEvent e)
void rad::SMAdapter::ProcessEvent ( const AnyEvent e)

Method invoked to trigger the processing of an event by the SM.

Parameters
[in]eRAD event to be processed by the SM
void rad::SMAdapter::SetLogLevel ( const std::string &  level)
void rad::SMAdapter::SetLogLevel ( const std::string &  level)

Sets the log level of the SM engine.

Parameters
[in]levelThe desired log level.
void rad::SMAdapter::Start ( )

Starts the SM model interpretation.

void rad::SMAdapter::Start ( )
void rad::SMAdapter::Stop ( )

Stops the SM model interpretation.

void rad::SMAdapter::Stop ( )

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