ActiveObject interface. More...
#include <ActiveObject.hpp>
Public Member Functions | |
virtual void | addTask (shared_ptr< Task > t) |
This method adds a task to be executed by the ActiveObject. | |
shared_ptr< CommunicationGateway > | getCommunicationGateway () |
Getter for the communication gateway. | |
ActiveObjectState | getState () |
Getter for the current state of the ActiveObject. | |
std::string | getStateString () |
Gets a string representation of the current ActiveObject's state. | |
virtual void | start ()=0 |
This method starts the ActiveObject. | |
virtual void | stop ()=0 |
This method stops the ActiveObject. | |
virtual | ~ActiveObject () |
Destructor. | |
Static Public Member Functions | |
static std::string | getStateString (ActiveObjectState state) |
Helper function that translates a given ActiveObjectState to a string. | |
Protected Member Functions | |
ActiveObject (ActiveObjectManager *aom) | |
Default constructor. | |
void | setState (ActiveObjectState s) |
Setter for the current state of the ActiveObject. | |
Protected Attributes | |
ActiveObjectManager * | aoManager_ |
Reference to the ActiveObjectManager instance. | |
shared_ptr< TaskScheduler > | taskScheduler_ |
Reference to the TaskScheduler used by this ActiveObject. | |
Friends | |
class | ActiveObjectManager |
ActiveObject interface.
Definition at line 58 of file ActiveObject.hpp.
ActiveObject::~ActiveObject | ( | ) | [virtual] |
Destructor.
Definition at line 57 of file ActiveObject.cpp.
ActiveObject::ActiveObject | ( | ActiveObjectManager * | aom | ) | [protected] |
Default constructor.
Definition at line 44 of file ActiveObject.cpp.
void ActiveObject::addTask | ( | shared_ptr< Task > | t | ) | [virtual] |
This method adds a task to be executed by the ActiveObject.
It should only be called from OUTSIDE the context of an ActiveObject. Calling it in the context of an ActiveObject will block the ActiveObject.
Reimplemented in mermaid::support::activeobject::ActiveObjectAce.
Definition at line 112 of file ActiveObject.cpp.
shared_ptr< CommunicationGateway > ActiveObject::getCommunicationGateway | ( | ) |
Getter for the communication gateway.
This methd should only be used in the execution context of the ActiveObject
Definition at line 123 of file ActiveObject.cpp.
ActiveObjectState ActiveObject::getState | ( | ) |
Getter for the current state of the ActiveObject.
Definition at line 62 of file ActiveObject.cpp.
std::string ActiveObject::getStateString | ( | ActiveObjectState | state | ) | [static] |
Helper function that translates a given ActiveObjectState to a string.
state | The state for which a string representation is needed. |
Definition at line 72 of file ActiveObject.cpp.
std::string ActiveObject::getStateString | ( | ) |
Gets a string representation of the current ActiveObject's state.
Definition at line 67 of file ActiveObject.cpp.
void ActiveObject::setState | ( | ActiveObjectState | s | ) | [protected] |
Setter for the current state of the ActiveObject.
s | State to which the ActiveObject should be set. |
Definition at line 102 of file ActiveObject.cpp.
virtual void mermaid::support::activeobject::ActiveObject::start | ( | ) | [pure virtual] |
This method starts the ActiveObject.
Implemented in mermaid::support::activeobject::ActiveObjectAce.
virtual void mermaid::support::activeobject::ActiveObject::stop | ( | ) | [pure virtual] |
This method stops the ActiveObject.
Implemented in mermaid::support::activeobject::ActiveObjectAce.
Reference to the ActiveObjectManager instance.
Definition at line 143 of file ActiveObject.hpp.
shared_ptr<TaskScheduler> mermaid::support::activeobject::ActiveObject::taskScheduler_ [protected] |
Reference to the TaskScheduler used by this ActiveObject.
Definition at line 140 of file ActiveObject.hpp.