Yacs++
 All Classes Functions
Public Member Functions | List of all members
Communication Class Reference

#include <Communication.hxx>

Public Member Functions

 Communication ()
 
 Communication (const Communication &compo)
 
int initialize (void *compo)
 
int terminate ()
 
int send (const int iteration, const std::string portName, const int &val)
 
int send (const int iteration, const std::string portName, const int size, IntPtrConst &tab)
 
int send (const int iteration, const std::string portName, const float &val)
 
int send (const int iteration, const std::string portName, const int size, FloatPtrConst &tab)
 
int send (const int iteration, const std::string portName, const double &val)
 
int send (const int iteration, const std::string portName, const int size, DoublePtrConst &tab)
 
int send (const int iteration, const std::string portName, const bool &val)
 
int send (const int iteration, const std::string portName, const int size, BoolPtrConst &tab)
 
int recv (int &iteration, const std::string portName, int &val)
 
int recv (int &iteration, const std::string portName, const int size, IntPtr &tab)
 
int recv (int &iteration, const std::string portName, float &val)
 
int recv (int &iteration, const std::string portName, const int size, FloatPtr &tab)
 
int recv (int &iteration, const std::string portName, double &val)
 
int recv (int &iteration, const std::string portName, const int size, DoublePtr &tab)
 
int recv (int &iteration, const std::string portName, bool &val)
 
int recv (int &iteration, const std::string portName, const int size, BoolPtr &tab)
 

Detailed Description

This class is an implementation of the C++ bindings for Calcium. Calcium capabilities with iteration synchronization are available for a program written in C++ by using methods belonging to the Communication class.

The Communication class uses predefined declarations for some datatypes:

#define IntPtr:   boost::shared_array<int_32>
#define FloatPtr:   boost::shared_array<float_32>
#define DoublePtr:   boost::shared_array<double_64>
#define BoolPtr:   boost::shared_array<bool>

Moreover, send methods are constructing shared arrays that cannot be modified in the calling C++ code. To prevent this, they are declared const using the following predefined declarations:

#define IntPtrConst:   boost::shared_array<const int_32>
#define FloatPtrConst:   boost::shared_array<const float_32>
#define DoublePtrConst:   boost::shared_array<const double_64>
#define BoolPtrConst:   boost::shared_array<const bool>
Author
Hadrien Leroyer, EDF and Alain Hebert, Ecole Polytechnique de Montreal (2013)

Constructor & Destructor Documentation

Communication::Communication ( )

use this constructor to create a new empty Communication object

Communication::Communication ( const Communication compo)

use this constructor to create a new Communication object with an embedded component

Parameters
compoembedded component

Member Function Documentation

int Communication::initialize ( void *  compo)

initialize the Communication object and set the embedded component

Parameters
compoembedded Calcium component
int Communication::recv ( int &  iteration,
const std::string  portName,
int &  val 
)

receive a single integer value

Parameters
iterationiteration index
portNamename of the datastream
valinteger value
int Communication::recv ( int &  iteration,
const std::string  portName,
const int  size,
IntPtr &  tab 
)

receive an integer array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the integer array
tabinteger array
int Communication::recv ( int &  iteration,
const std::string  portName,
float &  val 
)

receive a single real value

Parameters
iterationiteration index
portNamename of the datastream
valreal value
int Communication::recv ( int &  iteration,
const std::string  portName,
const int  size,
FloatPtr &  tab 
)

receive an real array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the real array
tabreal array
int Communication::recv ( int &  iteration,
const std::string  portName,
double &  val 
)

receive a single double precision real value

Parameters
iterationiteration index
portNamename of the datastream
valdouble precision real value
int Communication::recv ( int &  iteration,
const std::string  portName,
const int  size,
DoublePtr &  tab 
)

receive an double precision real array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the double precision real array
tabdouble precision real array
int Communication::recv ( int &  iteration,
const std::string  portName,
bool &  val 
)

receive a single boolean value

Parameters
iterationiteration index
portNamename of the datastream
valboolean value
int Communication::recv ( int &  iteration,
const std::string  portName,
const int  size,
BoolPtr &  tab 
)

receive a boolean array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the oolean array
tabboolean array
int Communication::send ( const int  iteration,
const std::string  portName,
const int &  val 
)

send a single integer value

Parameters
iterationiteration index
portNamename of the datastream
valinteger value
int Communication::send ( const int  iteration,
const std::string  portName,
const int  size,
IntPtrConst &  tab 
)

send an integer array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the integer array
tabinteger array
int Communication::send ( const int  iteration,
const std::string  portName,
const float &  val 
)

send a single real value

Parameters
iterationiteration index
portNamename of the datastream
valreal value
int Communication::send ( const int  iteration,
const std::string  portName,
const int  size,
FloatPtrConst &  tab 
)

send an real array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the real array
tabreal array
int Communication::send ( const int  iteration,
const std::string  portName,
const double &  val 
)

send a single double precision real value

Parameters
iterationiteration index
portNamename of the datastream
valdouble precision real value
int Communication::send ( const int  iteration,
const std::string  portName,
const int  size,
DoublePtrConst &  tab 
)

send an double precision real array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the double precision real array
tabdouble precision real array
int Communication::send ( const int  iteration,
const std::string  portName,
const bool &  val 
)

send a single boolean value

Parameters
iterationiteration index
portNamename of the datastream
valboolean value
int Communication::send ( const int  iteration,
const std::string  portName,
const int  size,
BoolPtrConst &  tab 
)

send an boolean array

Parameters
iterationiteration index
portNamename of the datastream
sizesize of the boolean array
tabboolean array
int Communication::terminate ( )

close the Communication object


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