Wiselib
Classes | Public Types | Public Member Functions
wiselib::TopologyMessage Class Reference

A message sent by a sensor in the BGU clustering algorithm. More...

#include <TopologyMessage.h>

Inherits wiselib::Message.

List of all members.

Classes

struct  serializable_topology_record_t
struct  topology_message_header_t

Public Types

typedef list_iterator
< topology_record_t
iterator

Public Member Functions

 TopologyMessage (nodeid_t sender)
 Construct an empty message.
 TopologyMessage (uint8_t *buffer, uint32_t buffer_length)
 De-serialize a message from a received buffer.
 ~TopologyMessage ()
error_code_t serialize (uint8_t *buffer, uint32_t buffer_size)
 Convert this message to a byte buffer.
size_t serializationBufferSize ()
error_code_t applyTo (wiselib::MessageDestination *dest)
 Allow a MessageDestination to handle this message.
error_code_t addTopologyRecord (const topology_record_t &record)
 Add some topology information to this message.
iterator begin ()
 The following two methods enable iterating over the topology information stored in the message.
iterator end ()
nodeid_t senderId ()
void convert (serializable_topology_record_t, topology_record_t *)
void convert (topology_record_t, serializable_topology_record_t *)

Detailed Description

A message sent by a sensor in the BGU clustering algorithm.

This message contains topology information as known to some node at some time.


Member Typedef Documentation


Constructor & Destructor Documentation

TopologyMessage::TopologyMessage ( nodeid_t  sender)

Construct an empty message.

Parameters:
senderthe nodeid of the sending node
TopologyMessage::TopologyMessage ( uint8_t buffer,
uint32_t  buffer_length 
)

De-serialize a message from a received buffer.

Parameters:
buffera buffer that was created by the serialize method.
buffer_lengththe length of the buffer
TopologyMessage::~TopologyMessage ( )

Member Function Documentation

error_code_t TopologyMessage::addTopologyRecord ( const topology_record_t record)

Add some topology information to this message.

Parameters:
recordthe information to add
error_code_t TopologyMessage::applyTo ( wiselib::MessageDestination dest) [virtual]

Allow a MessageDestination to handle this message.

We work this way to make it possible to decouple the messages from the destinations.

Parameters:
destthe message destination
Returns:
ecSuccess on success, some other code on failure.

Implements wiselib::Message.

TopologyMessage::iterator TopologyMessage::begin ( )

The following two methods enable iterating over the topology information stored in the message.

void TopologyMessage::convert ( serializable_topology_record_t  in,
topology_record_t out 
)
void TopologyMessage::convert ( topology_record_t  in,
serializable_topology_record_t out 
)
TopologyMessage::iterator TopologyMessage::end ( )
nodeid_t TopologyMessage::senderId ( )
size_t TopologyMessage::serializationBufferSize ( )
Returns:
the required size for a buffer that can contain a representation of this message.
error_code_t TopologyMessage::serialize ( uint8_t buffer,
uint32_t  buffer_size 
) [virtual]

Convert this message to a byte buffer.

Parameters:
bufferthe buffer where the result is stored
buffer_sizethe size of the buffer.
Returns:
ecSuccess on success, some other code on failure.

Implements wiselib::Message.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines