MipResources::CommModule Class Reference
[Communication module]

abstract communication module More...

#include <CommModule.h>

Inheritance diagram for MipResources::CommModule:

MipResources::Resource MIPObject MipResources::DirectStreamCommModule MipResources::IPCommModule

List of all members.

Public Member Functions

 CommModule ()
 constructor
bool storePacketString (string &packetString)
 Store a packet (interface for the listener).
void requestBox (int task)
 Request a box for the task (interface for the task).
int requestBox (string taskName)
 Request a box for the task (interface for the task).
bool receive (int task, CommBox &packets)
 Return a vector of packets to the task (interface for the task).
void receiveAck (int task, CommBox &packets)
 Acknowledge of the received packets (interface for the task).
void send (CommPacket packet)
 Send a packet (interface for the task).
virtual bool sendPacketString (string &packetString, CommNode recipient)=0
 Send a packetString.
string print ()
 Print function.

Protected Attributes

CommModulePar_par
CommModuleVar_var
bool on
 every inherited class constructor must set this flag to true


Detailed Description

abstract communication module

Author:
Fabrizio Ramundo
Examples:

exampleCommModule.cpp.


Constructor & Destructor Documentation

MipResources::CommModule::CommModule (  )  [inline]

constructor


Member Function Documentation

bool MipResources::CommModule::storePacketString ( string &  packetString  ) 

Store a packet (interface for the listener).

Parameters:
packetString a string containing a serialized CommPacket
Todo:
to protect (left public only for example)

void MipResources::CommModule::requestBox ( int  task  ) 

Request a box for the task (interface for the task).

Parameters:
task the task number (plate)
Examples:
exampleCommModule.cpp.

int MipResources::CommModule::requestBox ( string  taskName  ) 

Request a box for the task (interface for the task).

Parameters:
task the task number (plate)

bool MipResources::CommModule::receive ( int  task,
CommBox packets 
)

Return a vector of packets to the task (interface for the task).

Parameters:
task the task number (plate)
[out] packets the CommBox containing pointers to the packets to receive
Examples:
exampleCommModule.cpp.

void MipResources::CommModule::receiveAck ( int  task,
CommBox packets 
)

Acknowledge of the received packets (interface for the task).

Parameters:
task the task number (plate)
[out] packets the CommBox containing pointers to the packets just received
Examples:
exampleCommModule.cpp.

void MipResources::CommModule::send ( CommPacket  packet  ) 

Send a packet (interface for the task).

Parameters:
packet the packet to send
Examples:
exampleCommModule.cpp.

virtual bool MipResources::CommModule::sendPacketString ( string &  packetString,
CommNode  recipient 
) [pure virtual]

Send a packetString.

Parameters:
packetString a string containing a serialized CommPacket
recipient recipient of the packet

Implemented in MipResources::DirectStreamCommModule, and MipResources::IPCommModule.

string MipResources::CommModule::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.

Reimplemented from MipResources::Resource.

Examples:
exampleCommModule.cpp.


Member Data Documentation

bool MipResources::CommModule::on [protected]

every inherited class constructor must set this flag to true


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