# cFileCommunications Class Reference
[Parallel simulation support]

Implementation of the communications layer which works via files. More...

`#include <cfilecomm.h>`

Inheritance diagram for cFileCommunications:

List of all members.

## Public Member Functions

| cFileCommunications ()
virtual | ~cFileCommunications ()
Redefined methods from cParsimCommunications
virtual void | init ()
virtual void | shutdown ()
virtual int | getNumPartitions ()
virtual int | getProcId ()
virtual cCommBuffer * | createCommBuffer ()
virtual void | recycleCommBuffer (cCommBuffer *buffer)
virtual void | send (cCommBuffer *buffer, int tag, int destination)
virtual bool | receiveBlocking (int filtTag, cCommBuffer *buffer, int &receivedTag, int &sourceProcId)
virtual bool | receiveNonblocking (int filtTag, cCommBuffer *buffer, int &receivedTag, int &sourceProcId)

## Detailed Description

Implementation of the communications layer which works via files.

Every message is created as a file in a communications directory.

It is VERY slow, and only useful for understanding, debugging or demonstrating parallel simulation.

## Constructor & Destructor Documentation

cFileCommunications::cFileCommunications | ( |  | ) |

| Constructor.

virtual cFileCommunications::~cFileCommunications | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

virtual cCommBuffer* cFileCommunications::createCommBuffer | ( |  | ) | `[virtual]`

| Creates an empty buffer of type cFileCommBuffer. Implements cParsimCommunications.

virtual int cFileCommunications::getNumPartitions | ( |  | ) | `[virtual]`

| Returns total number of partitions. Implements cParsimCommunications.

virtual int cFileCommunications::getProcId | ( |  | ) | `[virtual]`

| Returns the id of this partition. Implements cParsimCommunications.

virtual void cFileCommunications::init | ( |  | ) | `[virtual]`

| Init the library. Implements cParsimCommunications.

virtual bool cFileCommunications::receiveBlocking | ( | int | filtTag,
|  | cCommBuffer * | buffer,
|  | int & | receivedTag,
|  | int & | sourceProcId
| ) | `[virtual]`

| Receives packed data with given tag from given destination. Normally returns true; false is returned if blocking was interrupted by the user. Implements cParsimCommunications.

virtual bool cFileCommunications::receiveNonblocking | ( | int | filtTag,
|  | cCommBuffer * | buffer,
|  | int & | receivedTag,
|  | int & | sourceProcId
| ) | `[virtual]`

| Receives packed data with given tag from given destination. Call is non-blocking -- it returns true if something has been received, false otherwise. Implements cParsimCommunications.

virtual void cFileCommunications::recycleCommBuffer | ( | cCommBuffer * | buffer | ) | `[virtual]`

| Recycle communication buffer after use. Implements cParsimCommunications.

virtual void cFileCommunications::send | ( | cCommBuffer * | buffer,
|  | int | tag,
|  | int | destination
| ) | `[virtual]`

| Sends packed data with given tag to destination. Implements cParsimCommunications.

virtual void cFileCommunications::shutdown | ( |  | ) | `[virtual]`

| Shutdown the communications library. Implements cParsimCommunications.

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

- cfilecomm.h