ifw
0.0.1-dev
|
#include <actionsSetup.hpp>
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 | |
ActionsSetup & | operator= (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 | |
ActionsSetup & | operator= (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 | |
ActionsSetup & | operator= (const ActionsSetup &)=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 | |
ActionGroup & | operator= (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 | |
ActionGroup & | operator= (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 | |
ActionGroup & | operator= (const ActionGroup &)=delete |
Disable copy constructor. More... | |
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.
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>> |
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.
[in] | ios | Reference to the event loop. |
[in] | dispatcher | Reference to the event dispatcher. |
[in] | msg_replier | Needed to reply back to the originator of commands. |
[in] | dataCtx | Reference to the application run-time data. |
|
virtual |
Destructor. Unsubscribes from the setup topic used to monitor when the setup is active.
|
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.
[in] | ios | Reference to the event loop. |
[in] | dispatcher | Reference to the event dispatcher. |
[in] | msg_replier | Needed to reply back to the originator of commands. |
[in] | dataCtx | Reference to the application run-time data. |
|
virtual |
Destructor. Unsubscribes from the setup topic used to monitor when the setup is active.
|
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.
[in] | ios | Reference to the event loop. |
[in] | dispatcher | Reference to the event dispatcher. |
[in] | msg_replier | Needed to reply back to the originator of commands. |
[in] | dataCtx | Reference to the application run-time data. |
|
virtual |
Destructor. Unsubscribes from the setup topic used to monitor when the setup is active.
|
delete |
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
[in] | last_event | Last 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
[in] | last_event | Last 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
[in] | last_event | Last 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.
[in] | last_event | Last 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.
[in] | last_event | Last 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.
[in] | last_event | Last event received. |
|
delete |
Disable copy constructor.
|
delete |
Disable copy constructor.
|
delete |
Disable copy constructor.
void devmgr::common::ActionsSetup::Start | ( | rad::AnyEvent const & | lastEvent | ) |
Implementation of the Start callback.
[in] | lastEvent | Setup 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.
[in] | lastEvent | Setup 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.
[in] | lastEvent | Setup 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:
[in] | last_event | Last 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:
[in] | last_event | Last 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:
[in] | last_event | Last 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.
[in] | last_event | Last 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.
[in] | last_event | Last 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.
[in] | last_event | Last event received. |