mermaid::support::activeobject::ActiveObject Class Reference

ActiveObject interface. More...

#include <ActiveObject.hpp>

Inheritance diagram for mermaid::support::activeobject::ActiveObject:
Inheritance graph
[legend]
Collaboration diagram for mermaid::support::activeobject::ActiveObject:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void addTask (shared_ptr< Task > t)
 This method adds a task to be executed by the ActiveObject.
shared_ptr< CommunicationGatewaygetCommunicationGateway ()
 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

ActiveObjectManageraoManager_
 Reference to the ActiveObjectManager instance.
shared_ptr< TaskSchedulertaskScheduler_
 Reference to the TaskScheduler used by this ActiveObject.

Friends

class ActiveObjectManager

Detailed Description

ActiveObject interface.

Author:
Marco Barbosa + Nelson Ramos

Definition at line 58 of file ActiveObject.hpp.


Constructor & Destructor Documentation

ActiveObject::~ActiveObject (  )  [virtual]

Destructor.

Author:
Marco Barbosa + Nelson Ramos

Definition at line 57 of file ActiveObject.cpp.

ActiveObject::ActiveObject ( ActiveObjectManager aom  )  [protected]

Default constructor.

Author:
Marco Barbosa + Nelson Ramos

Definition at line 44 of file ActiveObject.cpp.


Member Function Documentation

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.

Author:
Marco Barbosa + Nelson Ramos

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

Author:
Marco Barbosa

Definition at line 123 of file ActiveObject.cpp.

ActiveObjectState ActiveObject::getState (  ) 

Getter for the current state of the ActiveObject.

Returns:
ActiveObjectState representing the current state of the ActiveObject.
Author:
Marco Barbosa + Nelson Ramos

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.

Parameters:
state The state for which a string representation is needed.
Returns:
string of the given state.
Author:
Marco Barbosa + Nelson Ramos

Definition at line 72 of file ActiveObject.cpp.

std::string ActiveObject::getStateString (  ) 

Gets a string representation of the current ActiveObject's state.

Returns:
string of the current state.
Author:
Marco Barbosa + Nelson Ramos

Definition at line 67 of file ActiveObject.cpp.

void ActiveObject::setState ( ActiveObjectState  s  )  [protected]

Setter for the current state of the ActiveObject.

Parameters:
s State to which the ActiveObject should be set.
Author:
Marco Barbosa + Nelson Ramos

Definition at line 102 of file ActiveObject.cpp.

virtual void mermaid::support::activeobject::ActiveObject::start (  )  [pure virtual]

This method starts the ActiveObject.

Author:
Marco Barbosa + Nelson Ramos

Implemented in mermaid::support::activeobject::ActiveObjectAce.

virtual void mermaid::support::activeobject::ActiveObject::stop (  )  [pure virtual]

This method stops the ActiveObject.

Author:
Marco Barbosa + Nelson Ramos

Implemented in mermaid::support::activeobject::ActiveObjectAce.


Member Data Documentation

Reference to the ActiveObjectManager instance.

Definition at line 143 of file ActiveObject.hpp.

Reference to the TaskScheduler used by this ActiveObject.

Definition at line 140 of file ActiveObject.hpp.

Generated on Fri Mar 4 22:15:42 2011 for MeRMaID::support by  doxygen 1.6.3