MipResources::CommPacket Class Reference
[Communication module]

Communication packet. More...

#include <CommModule.h>

List of all members.

Public Member Functions

 CommPacket ()
 Default constructor.
 CommPacket (string message, string messageType, CommNode sender, CommNode recipient)
 Complete constructor.
 CommPacket (const CommPacket &p)
 Copy constructor.
CommPacketoperator= (const CommPacket &p)
 assigment operator =.
bool deleteRecipientId (const int id)
 Deletes a recipient id from the _recipient._ids list.
bool deleteRecipientTask (const int task)
 Deletes a Task id from the _recipient._tasks list.
string message ()
 Returns the message.
string messageType ()
 Returns the messageType.
CommNode sender ()
 Returns the sender.
CommNode recipient ()
 Returns the recipient.
Time time ()
 Returns the time.
void setSender (const CommNode &sender)
 Returns the time.
void setRecipient (const CommNode &recipient)
 Returns the time.
string print ()
 Print function.

Friends

class boost::serialization::access


Detailed Description

Communication packet.

Author:
Fabrizio Ramundo This class represents a single communication packet. It uses the boost serialization function, and has inside the message, the message type, sender address, recipient address and the time.
Examples:

exampleCommModule.cpp.


Constructor & Destructor Documentation

MipResources::CommPacket::CommPacket (  ) 

Default constructor.

This constructor doesn't do anything.

MipResources::CommPacket::CommPacket ( string  message,
string  messageType,
CommNode  sender,
CommNode  recipient 
)

Complete constructor.

This constructor completely create a packet, with all information needed for sending or reading it.

Parameters:
message String with the message to be sent or read.
messageType String containing the type of the message to be sentor read.
sender CommNode that represents the sender address.
recipient CommNode that represents the receipient address.

MipResources::CommPacket::CommPacket ( const CommPacket p  ) 

Copy constructor.

This constructor completely create a packet, copying it from another CommPacket.


Member Function Documentation

CommPacket & MipResources::CommPacket::operator= ( const CommPacket p  ) 

assigment operator =.

bool MipResources::CommPacket::deleteRecipientId ( const int  id  ) 

Deletes a recipient id from the _recipient._ids list.

Parameters:
[in] id the id of the recipient to cancel
Returns:
true if the recipient has been cancelled.false otherwise.

bool MipResources::CommPacket::deleteRecipientTask ( const int  task  ) 

Deletes a Task id from the _recipient._tasks list.

Parameters:
[in] id the id of the task to cancel
Returns:
true if the task has been cancelled.false otherwise.

string MipResources::CommPacket::message (  ) 

Returns the message.

This function returns a string representing the message contained in the CommPacket.

Returns:
string, containing the message of the packet.
Examples:
exampleCommModule.cpp.

string MipResources::CommPacket::messageType (  ) 

Returns the messageType.

This function returns a string representing the type of the message contained in the CommPacket.

Returns:
string, containing the messageType field of the packet.
Examples:
exampleCommModule.cpp.

CommNode MipResources::CommPacket::sender (  ) 

Returns the sender.

This function returns a CommNode representing the sender of the message contained in the CommPacket.

Returns:
CommNode, containing the sender of the packet.
Examples:
exampleCommModule.cpp.

CommNode MipResources::CommPacket::recipient (  ) 

Returns the recipient.

This function returns a CommNode representing the recipient of the message contained in the CommPacket.

Returns:
CommNode, containing the recipient of the packet.

Time MipResources::CommPacket::time (  ) 

Returns the time.

This function returns the time of this packet.

Returns:
Time, containing the time of the packet.
Examples:
exampleCommModule.cpp.

void MipResources::CommPacket::setSender ( const CommNode sender  ) 

Returns the time.

This function sets the sender of the packet.

Parameters:
sender CommNode representing the sender to set.

void MipResources::CommPacket::setRecipient ( const CommNode recipient  ) 

Returns the time.

This function sets the recipient of the packet.

Parameters:
sender CommNode representing the recipient to set.

string MipResources::CommPacket::print (  ) 

Print function.

This function returns a string that can be printed, with all the informations contained in the class.

Returns:
The string that can be printed.


Friends And Related Function Documentation

friend class boost::serialization::access [friend]


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

Generated on Mon Feb 20 07:01:12 2017 for MIP by  doxygen 1.5.6