shawn::Message Class Reference

Superclass of all messages. More...

#include <message.h>

Inheritance diagram for shawn::Message:

Inheritance graph
[legend]
Collaboration diagram for shawn::Message:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void setSize (int) throw ()
construction / destruction
 Message ()
virtual ~Message ()
Type of message
virtual bool is_unicast (void) const throw ()
virtual int unicast_target (void) const throw ()
virtual bool is_loopback_message (void) const throw ()
Message properties
const Nodesource (void) const throw ()
Nodesource_w (void) const throw ()
bool has_source (void) const throw ()
int timestamp_simulation_round (void) const throw ()
double timestamp_time (void) const throw ()
void set_source (Node &) throw ()
void set_timestamp (int, double) throw ()
virtual int size (void) const throw ()


Detailed Description

Superclass of all messages.

Abstract superclass. Derive specific message types to get specialized message classes.

It is not always necessary to overload anything or to add methods in derived classes -- type detection via dynamic_cast<>() may be sufficient.


Constructor & Destructor Documentation

shawn::Message::Message (  ) 

virtual shawn::Message::~Message (  )  [virtual]


Member Function Documentation

virtual bool shawn::Message::is_unicast ( void   )  const throw () [virtual]

Returns:
whether this message is to be sent to a single node, unicast_target(), only. If receiver is no neighbor of the sender, the message will be silently lost.
This implementation always returns false, ie, all messages are broadcast by default.
See also:
unicast_target()

virtual int shawn::Message::unicast_target ( void   )  const throw () [virtual]

Target of a unicast message.

Warning:
Use of ID numbers might be replaced by (Node*) soon

virtual bool shawn::Message::is_loopback_message ( void   )  const throw () [virtual]

Returns:
whether the message is received not only by neighbors, but also by the sender itself. Only useful if is_unicast() is false.
This implementation always returns false, ie, all messages are broadcast by default.

const Node& shawn::Message::source ( void   )  const throw ()

ID of the sender. Set via set_source() automatically from within Processor::send() resp. Node::send().

Node& shawn::Message::source_w ( void   )  const throw ()

ID of the sender. Set via set_source() automatically from within Processor::send() resp. Node::send().

bool shawn::Message::has_source ( void   )  const throw ()

Returns:
true if source has already been set, false if source is still NULL..

int shawn::Message::timestamp_simulation_round ( void   )  const throw ()

Simulation round when message was sent. Set via set_timestamp() automatically from within Processor::send() resp. Node::send().

double shawn::Message::timestamp_time ( void   )  const throw ()

Time when message was sent. Set via set_timestamp() automatically from within Processor::send() resp. Node::send().

void shawn::Message::set_source ( Node  )  throw ()

Called by Processor::send() resp. Node::send().

void shawn::Message::set_timestamp ( int  ,
double   
) throw ()

Called by Processor::send() resp. Node::send().

virtual int shawn::Message::size ( void   )  const throw () [virtual]

virtual void shawn::Message::setSize ( int   )  throw () [virtual]


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

Generated on Sun Feb 5 00:00:57 2012 for Shawn by  doxygen 1.5.6