ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
devmgr::common::ActionsSetup Class Reference

#include <actionsSetup.hpp>

Inheritance diagram for devmgr::common::ActionsSetup:
rad::ActionGroup rad::ActionGroup rad::ActionGroup

Public Types

using ActivityMap = std::map< std::string, std::shared_ptr< scxml4cpp::Activity >>
 Disable assignment operator. More...
 
using ActivityPair = std::pair< std::string, std::shared_ptr< scxml4cpp::Activity >>
 
using ActivityMap = std::map< std::string, std::shared_ptr< scxml4cpp::Activity >>
 Disable assignment operator. More...
 
using ActivityPair = std::pair< std::string, std::shared_ptr< scxml4cpp::Activity >>
 
using ActivityMap = std::map< std::string, std::shared_ptr< scxml4cpp::Activity >>
 Disable assignment operator. More...
 
using ActivityPair = std::pair< std::string, std::shared_ptr< scxml4cpp::Activity >>
 

Public Member Functions

 ActionsSetup (boost::asio::io_service &ios, rad::SMAdapter &sm, rad::Dispatcher &dispatcher, rad::MsgReplier &msg_replier, DataContext &data_ctx, DeviceFacade &device_facade)
 
virtual ~ActionsSetup ()
 
void Start (rad::AnyEvent const &lastEvent)
 Implementation of the Start callback. More...
 
void Stop (rad::AnyEvent const &lastEvent)
 
void Done (rad::AnyEvent const &lastEvent)
 
void Timeout (rad::AnyEvent const &lastEvent)
 
void Error (rad::AnyEvent const &lastEvent)
 
 ActionsSetup (const ActionsSetup &)=delete
 
ActionsSetupoperator= (const ActionsSetup &)=delete
 Disable copy constructor. More...
 
 ActionsSetup (boost::asio::io_service &ios, rad::SMAdapter &sm, rad::Dispatcher &dispatcher, rad::MsgReplier &msg_replier, DataContext &data_ctx, DeviceFacade &device_facade)
 
virtual ~ActionsSetup ()
 
void Start (rad::AnyEvent const &lastEvent)
 Implementation of the Start callback. More...
 
void Stop (rad::AnyEvent const &lastEvent)
 
void Done (rad::AnyEvent const &lastEvent)
 
void Timeout (rad::AnyEvent const &lastEvent)
 
void Error (rad::AnyEvent const &lastEvent)
 
 ActionsSetup (const ActionsSetup &)=delete
 
ActionsSetupoperator= (const ActionsSetup &)=delete
 Disable copy constructor. More...
 
 ActionsSetup (boost::asio::io_service &ios, rad::SMAdapter &sm, rad::Dispatcher &dispatcher, rad::MsgReplier &msg_replier, DataContext &data_ctx, DeviceFacade &device_facade)
 
virtual ~ActionsSetup ()
 
void Start (rad::AnyEvent const &lastEvent)
 Implementation of the Start callback. More...
 
void Stop (rad::AnyEvent const &lastEvent)
 
void Done (rad::AnyEvent const &lastEvent)
 
void Timeout (rad::AnyEvent const &lastEvent)
 
void Error (rad::AnyEvent const &lastEvent)
 
 ActionsSetup (const ActionsSetup &)=delete
 
ActionsSetupoperator= (const ActionsSetup &)=delete
 Disable copy constructor. More...
 
- Public Member Functions inherited from rad::ActionGroup
 ActionGroup (const std::string &id)
 
virtual ~ActionGroup ()
 
const std::string & GetId () const
 
void SetId (const std::string &id)
 
 ActionGroup (const ActionGroup &)=delete
 
ActionGroupoperator= (const ActionGroup &)=delete
 Disable copy constructor. More...
 
 ActionGroup (const std::string &id)
 
virtual ~ActionGroup ()
 
const std::string & GetId () const
 
void SetId (const std::string &id)
 
 ActionGroup (const ActionGroup &)=delete
 
ActionGroupoperator= (const ActionGroup &)=delete
 Disable copy constructor. More...
 
 ActionGroup (const std::string &id)
 
virtual ~ActionGroup ()
 
const std::string & GetId () const
 
void SetId (const std::string &id)
 
 ActionGroup (const ActionGroup &)=delete
 
ActionGroupoperator= (const ActionGroup &)=delete
 Disable copy constructor. More...
 

Detailed Description

This class is grouping the actions related to the Setup event. For each new setup event, a thread is created (TaskSetup object) that is doing the actions associated to the setup command. This allows the server to handle concurrent setup events. Handling of conflicts between devices addressed in several setups threads shall be handled at the controller side.

The ActionSetup class subscribes to the events produced by the TaskSetup object. The reason to use event subscription is because this is handled outside the state machine engine. The payload of each of the events contains the thread id that enables to identify which thread is generating the event.

This class handles internally a map with the information about the active threads. Every time a setup is started, a new entry is created in the map containing an identifier (thread id) and the thread object. When the setup finishes, the thread object is deleted and the entry is removed from the map.

See Also
TaskSetup

Member Typedef Documentation

using devmgr::common::ActionsSetup::ActivityMap = std::map<std::string,std::shared_ptr<scxml4cpp::Activity>>

Disable assignment operator.

using devmgr::common::ActionsSetup::ActivityMap = std::map<std::string,std::shared_ptr<scxml4cpp::Activity>>

Disable assignment operator.

using devmgr::common::ActionsSetup::ActivityMap = std::map<std::string,std::shared_ptr<scxml4cpp::Activity>>

Disable assignment operator.

using devmgr::common::ActionsSetup::ActivityPair = std::pair<std::string, std::shared_ptr<scxml4cpp::Activity>>
using devmgr::common::ActionsSetup::ActivityPair = std::pair<std::string, std::shared_ptr<scxml4cpp::Activity>>
using devmgr::common::ActionsSetup::ActivityPair = std::pair<std::string, std::shared_ptr<scxml4cpp::Activity>>

Constructor & Destructor Documentation

devmgr::common::ActionsSetup::ActionsSetup ( boost::asio::io_service &  ios,
rad::SMAdapter sm,
rad::Dispatcher dispatcher,
rad::MsgReplier msg_replier,
DataContext data_ctx,
DeviceFacade device_facade 
)

Constructor.

Parameters
[in]iosReference to the event loop.
[in]dispatcherReference to the event dispatcher.
[in]msg_replierNeeded to reply back to the originator of commands.
[in]dataCtxReference to the application run-time data.
devmgr::common::ActionsSetup::~ActionsSetup ( )
virtual

Destructor. Unsubscribes from the setup topic used to monitor when the setup is active.

devmgr::common::ActionsSetup::ActionsSetup ( const ActionsSetup )
delete
devmgr::common::ActionsSetup::ActionsSetup ( boost::asio::io_service &  ios,
rad::SMAdapter sm,
rad::Dispatcher dispatcher,
rad::MsgReplier msg_replier,
DataContext data_ctx,
DeviceFacade device_facade 
)

Constructor.

Parameters
[in]iosReference to the event loop.
[in]dispatcherReference to the event dispatcher.
[in]msg_replierNeeded to reply back to the originator of commands.
[in]dataCtxReference to the application run-time data.
virtual devmgr::common::ActionsSetup::~ActionsSetup ( )
virtual

Destructor. Unsubscribes from the setup topic used to monitor when the setup is active.

devmgr::common::ActionsSetup::ActionsSetup ( const ActionsSetup )
delete
devmgr::common::ActionsSetup::ActionsSetup ( boost::asio::io_service &  ios,
rad::SMAdapter sm,
rad::Dispatcher dispatcher,
rad::MsgReplier msg_replier,
DataContext data_ctx,
DeviceFacade device_facade 
)

Constructor.

Parameters
[in]iosReference to the event loop.
[in]dispatcherReference to the event dispatcher.
[in]msg_replierNeeded to reply back to the originator of commands.
[in]dataCtxReference to the application run-time data.
virtual devmgr::common::ActionsSetup::~ActionsSetup ( )
virtual

Destructor. Unsubscribes from the setup topic used to monitor when the setup is active.

devmgr::common::ActionsSetup::ActionsSetup ( const ActionsSetup )
delete

Member Function Documentation

void devmgr::common::ActionsSetup::Done ( rad::AnyEvent const lastEvent)

Implementation of the Done callback. This method implements the actions when the Setup event was finalized.// System headers

Parameters
[in]last_eventLast event received.
void devmgr::common::ActionsSetup::Done ( rad::AnyEvent const lastEvent)

Implementation of the Done callback. This method implements the actions when the Setup event was finalized.// System headers

Parameters
[in]last_eventLast event received.
void devmgr::common::ActionsSetup::Done ( rad::AnyEvent const lastEvent)

Implementation of the Done callback. This method implements the actions when the Setup event was finalized.// System headers

Parameters
[in]last_eventLast event received.
void devmgr::common::ActionsSetup::Error ( rad::AnyEvent const lastEvent)

Implementation of the Error callback. This method implements the actions when the Setup event was finalized with an error.

Parameters
[in]last_eventLast event received.
void devmgr::common::ActionsSetup::Error ( rad::AnyEvent const lastEvent)

Implementation of the Error callback. This method implements the actions when the Setup event was finalized with an error.

Parameters
[in]last_eventLast event received.
void devmgr::common::ActionsSetup::Error ( rad::AnyEvent const lastEvent)

Implementation of the Error callback. This method implements the actions when the Setup event was finalized with an error.

Parameters
[in]last_eventLast event received.
ActionsSetup& devmgr::common::ActionsSetup::operator= ( const ActionsSetup )
delete

Disable copy constructor.

ActionsSetup& devmgr::common::ActionsSetup::operator= ( const ActionsSetup )
delete

Disable copy constructor.

ActionsSetup& devmgr::common::ActionsSetup::operator= ( const ActionsSetup )
delete

Disable copy constructor.

void devmgr::common::ActionsSetup::Start ( rad::AnyEvent const lastEvent)

Implementation of the Start callback.

Parameters
[in]lastEventSetup event.

Retrieves from the Setup event the associated payload and creates a worker task to manage the setup command. It store the created task in an internal map to be able to stop it later if needed.

void devmgr::common::ActionsSetup::Start ( rad::AnyEvent const lastEvent)

Implementation of the Start callback.

Parameters
[in]lastEventSetup event.

Retrieves from the Setup event the associated payload and creates a worker task to manage the setup command. It store the created task in an internal map to be able to stop it later if needed.

void devmgr::common::ActionsSetup::Start ( rad::AnyEvent const lastEvent)

Implementation of the Start callback.

Parameters
[in]lastEventSetup event.

Retrieves from the Setup event the associated payload and creates a worker task to manage the setup command. It store the created task in an internal map to be able to stop it later if needed.

void devmgr::common::ActionsSetup::Stop ( rad::AnyEvent const lastEvent)

Implementation of the Stop callback. This callback:

  • replies back for the originator of the ReqStop request.
Parameters
[in]last_eventLast event received which should be a Stop event (the Stop event is triggered by a ReqStop request).
void devmgr::common::ActionsSetup::Stop ( rad::AnyEvent const lastEvent)

Implementation of the Stop callback. This callback:

  • replies back for the originator of the ReqStop request.
Parameters
[in]last_eventLast event received which should be a Stop event (the Stop event is triggered by a ReqStop request).
void devmgr::common::ActionsSetup::Stop ( rad::AnyEvent const lastEvent)

Implementation of the Stop callback. This callback:

  • replies back for the originator of the ReqStop request.
Parameters
[in]last_eventLast event received which should be a Stop event (the Stop event is triggered by a ReqStop request).
void devmgr::common::ActionsSetup::Timeout ( rad::AnyEvent const lastEvent)

Implementation of the Timeout callback. This method implements the actions when the Setup event was finalized unexpectly.

Parameters
[in]last_eventLast event received.
void devmgr::common::ActionsSetup::Timeout ( rad::AnyEvent const lastEvent)

Implementation of the Timeout callback. This method implements the actions when the Setup event was finalized unexpectly.

Parameters
[in]last_eventLast event received.
void devmgr::common::ActionsSetup::Timeout ( rad::AnyEvent const lastEvent)

Implementation of the Timeout callback. This method implements the actions when the Setup event was finalized unexpectly.

Parameters
[in]last_eventLast event received.

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