# cNamedPipeCommunications Class Reference
[Parallel simulation support]

Implementation of the communications layer which uses named pipes. More...

`#include <cnamedpipecomm.h>`

Inheritance diagram for cNamedPipeCommunications:

List of all members.

## Public Member Functions

| cNamedPipeCommunications ()
virtual | ~cNamedPipeCommunications ()
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 uses named pipes.

Pipes are created at initialization time, and are used throughout the whole simulation.

## Constructor & Destructor Documentation

cNamedPipeCommunications::cNamedPipeCommunications | ( |  | ) |

| Constructor.

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

| Destructor.

## Member Function Documentation

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

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

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

| Returns total number of partitions. Implements cParsimCommunications.

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

| Returns the id of this partition. Implements cParsimCommunications.

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

| Init the library. Here we create and open the named pipes. Implements cParsimCommunications.

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

| Receives packed data, and also returns tag and source procId. Normally returns true; false is returned if blocking was interrupted by the user. Implements cParsimCommunications.

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

| Receives packed data, and also returns tag and source procId. Call is non-blocking -- it returns true if something has been received, false otherwise. Implements cParsimCommunications.

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

| Recycle communication buffer after use. Implements cParsimCommunications.

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

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

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

| Shutdown the communications library. Closes and removes the named pipes. Implements cParsimCommunications.

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

- cnamedpipecomm.h