AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
A class which implements a DRAMA Message Handler.
Interface only. Users must sub-class and implement Request MessageReceived(). They may also want to implement ActionEnd().
A MessageHandler is used to handle Obey or Kick messages in particular. They might be used to implement an action or an action reschedule handler, or an action kick handler.
These objects can then be supplied to the drama::Task::Add() methods or the MessageHandler::PutObeyHandler() or MessageHandler::PutKickHandler() methods. One of these is also returned by drama::Spawnable::Spawn().
#include "messagehandler.hh"
Public Member Functions | |
MessageHandler () | |
Create a DRAMA action/message handler object. | |
MessageHandler (const MessageHandler &source)=delete | |
Assignment operator deleted. | |
MessageHandler (MessageHandler &&source)=default | |
Move assignment operator. | |
virtual | ~MessageHandler () |
MessageHandler destructor. | |
virtual const EntryInfo & | GetEntry () |
Return the action entry details. | |
virtual std::shared_ptr< Task > | GetTask () const |
Returns a pointer to the task. | |
template<typename... Types> | |
void | MessageUser (const char *format, Types... args) |
Use DRAMA to send a message to the user - safe format. | |
virtual void | MessageUser (const std::string &text) const |
Use DRAMA to send a message to the user. | |
MessageHandler & | operator= (const MessageHandler &rhs)=delete |
Copy operator deleted. | |
MessageHandler & | operator= (MessageHandler &&rhs)=default |
Move operator. | |
virtual void | PutKickHandler (MessageHandlerPtr obj) |
Put a message handler object for the next Kick event. | |
virtual void | PutKickHandler (MessageReceiveFunction func) |
Put a message handler function for the next Kick event. | |
virtual void | PutObeyHandler (MessageHandlerPtr obj) |
Put a message handler object for the next Obey reschedule event. | |
virtual void | PutObeyHandler (MessageReceiveFunction func) |
Put a message handler function for the next Obey reschedule event. | |
virtual const sds::PrintObjectCR & | SdsListToUser () const |
Get a reference to an SDS printer object which can be used to list an SDS object using MessageUser. | |
void | SendBulkTrigger (BulkData *arg, DitsTransIdType *transId, bool isSds, unsigned notifyBytes=1024 *1024) |
Send a bulk data trigger message to the parent action. | |
void | SendBulkTrigger (BulkDataSds *arg, DitsTransIdType *transId, unsigned notifyBytes=1024 *1024) |
Send a bulk data trigger message to the parent action. | |
void | SendTrigger (const sds::Id &arg) const |
Send a trigger message to the parent action. | |
void | SetAction (Action *action) |
Invoked when the ActionHandler is associated with a DRAMA action entry (object type Action). | |
void | SetReturnArg (const sds::Id &arg, bool copy=true) |
Set the argument to be sent as part of the action completion message. | |
void | SetReturnArg (sds::Id *arg) |
Set the argument to be sent as part of the action completion message. | |
Protected Member Functions | |
virtual void | ActionEnd (bool taskExiting, StatusType actionEndStatus) |
Method Invoked when the action completes. | |
void | GrabEntryInfo () |
Fetch the DRAMA Entry information. | |
virtual Request | MessageReceived ()=0 |
Method invoked by DRAMA to handle the message. | |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:35 for AAO DRAMA/DRAMA2 C++ Interface by 1.9.8