AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | Protected Member Functions | List of all members
drama::Spawnable Class Referenceabstract

Detailed Description

A class which implements a Spawnable DRAMA Message Handler.

Interface only. Users must sub-class and implement Spawn() and End().

In DRAMA, a "spawnable" action is one where then can be multiple action of the same name running at the same time. By default, only one action of given name can be running at one time, but spawnable actions don't have that restriction. They are a little more expensive in terms of performance.

The user implements a sub-class of this interface and provides methods invoked when the action is spawned and when it completes. The Spawn() method is invoked when the action is spawned (an obey message of the specified name is received), and must return a shared pointer to an object to handle the obey message.

These objects can then be supplied to the drama::Task::AddSpawnable() methods to add such an action to the task.

Author
Tony Farrell, AAO $Revision$ $Date$

#include "spawnable.hh"

Inherits drama::ActionHandler.

Public Member Functions

 Spawnable ()
 Create a DRAMA spawnable action action handler object.
 
 Spawnable (const Spawnable &source)=delete
 Assignment operator deleted.
 
 Spawnable (Spawnable &&source)=default
 Move assignment operator.
 
virtual ~Spawnable ()
 Spawnable destructor.
 
virtual void ActionEnd (MessageHandlerPtr obj)=0
 Invoked when the spawned action has completed.
 
virtual std::shared_ptr< TaskGetTask () const
 Returns a pointer to the task.
 
Spawnableoperator= (const Spawnable &rhs)=delete
 Copy operator deleted.
 
Spawnableoperator= (Spawnable &&rhs)=default
 Move operator.
 
void SetAction (Action *action)
 Invoked when the ActionHandler is associated with a DRAMA action entry (object type Action).
 

Protected Member Functions

virtual MessageHandlerPtr Spawn ()=0
 An Action has been spawned, return a handler for the message.
 

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