#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) |
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> |
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
compo | embedded component |
int Communication::initialize | ( | void * | compo | ) |
initialize the Communication object and set the embedded component
compo | embedded Calcium component |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
int & | val | ||
) |
receive a single integer value
iteration | iteration index |
portName | name of the datastream |
val | integer value |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
const int | size, | ||
IntPtr & | tab | ||
) |
receive an integer array
iteration | iteration index |
portName | name of the datastream |
size | size of the integer array |
tab | integer array |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
float & | val | ||
) |
receive a single real value
iteration | iteration index |
portName | name of the datastream |
val | real value |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
const int | size, | ||
FloatPtr & | tab | ||
) |
receive an real array
iteration | iteration index |
portName | name of the datastream |
size | size of the real array |
tab | real array |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
double & | val | ||
) |
receive a single double precision real value
iteration | iteration index |
portName | name of the datastream |
val | double precision real value |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
const int | size, | ||
DoublePtr & | tab | ||
) |
receive an double precision real array
iteration | iteration index |
portName | name of the datastream |
size | size of the double precision real array |
tab | double precision real array |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
bool & | val | ||
) |
receive a single boolean value
iteration | iteration index |
portName | name of the datastream |
val | boolean value |
int Communication::recv | ( | int & | iteration, |
const std::string | portName, | ||
const int | size, | ||
BoolPtr & | tab | ||
) |
receive a boolean array
iteration | iteration index |
portName | name of the datastream |
size | size of the oolean array |
tab | boolean array |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const int & | val | ||
) |
send a single integer value
iteration | iteration index |
portName | name of the datastream |
val | integer value |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const int | size, | ||
IntPtrConst & | tab | ||
) |
send an integer array
iteration | iteration index |
portName | name of the datastream |
size | size of the integer array |
tab | integer array |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const float & | val | ||
) |
send a single real value
iteration | iteration index |
portName | name of the datastream |
val | real value |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const int | size, | ||
FloatPtrConst & | tab | ||
) |
send an real array
iteration | iteration index |
portName | name of the datastream |
size | size of the real array |
tab | real array |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const double & | val | ||
) |
send a single double precision real value
iteration | iteration index |
portName | name of the datastream |
val | double precision real value |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const int | size, | ||
DoublePtrConst & | tab | ||
) |
send an double precision real array
iteration | iteration index |
portName | name of the datastream |
size | size of the double precision real array |
tab | double precision real array |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const bool & | val | ||
) |
send a single boolean value
iteration | iteration index |
portName | name of the datastream |
val | boolean value |
int Communication::send | ( | const int | iteration, |
const std::string | portName, | ||
const int | size, | ||
BoolPtrConst & | tab | ||
) |
send an boolean array
iteration | iteration index |
portName | name of the datastream |
size | size of the boolean array |
tab | boolean array |
int Communication::terminate | ( | ) |
close the Communication object