karoo::rock_datagram_reply Class Reference

This class is an executable class that is run when an ACK message is received for a previously sent message. More...

#include <rock.h>

Inheritance diagram for karoo::rock_datagram_reply:

karoo::referable

List of all members.

Public Member Functions

 rock_datagram_reply (rock_datagram_message *msg)
 Create a reply object.
virtual void run ()=0
 handle the reply.

Protected Attributes

rock_datagram_messagemsg
 the message that was sent
rock_datagram_messageack_msg
 The ACK message that was received.

Friends

class rock


Detailed Description

This class is an executable class that is run when an ACK message is received for a previously sent message.

It has a pure virtual, the run() method, which you must implement.


Constructor & Destructor Documentation

karoo::rock_datagram_reply::rock_datagram_reply ( rock_datagram_message msg  ) 

Create a reply object.

This object will be associated with a rock_datagram_message that is to be sent. Then when the ACK is received, this reply object will be run in the general_pool.

Parameters:
msg the message that this reply is associated with.


Member Function Documentation

virtual void karoo::rock_datagram_reply::run (  )  [pure virtual]

handle the reply.

Typically what you'd have in here is a parser that reads the type of the ack_msg, and its reply data (if any) and then runs some operation... or, you may create a new class for each section of the code. This run() in effect carries on where the "caller" (which sent the datagram) left off. In this sense it will be like a "return" from a function, the "function call" being the sending of the datagram, and the execution of the "function" happening remotely.


Member Data Documentation

The ACK message that was received.

If this is NULL, then it means that the ACK was not received, and in fact, the run() method is called in this case for a NACK.


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

Generated on Tue Feb 16 15:04:29 2010 for Karoo by  doxygen 1.5.8