My Project
 All Classes Namespaces Functions Friends
Public Member Functions | Friends | List of all members
ganlib::Clcm Class Reference

#include <Clcm.hxx>

Public Member Functions

 Clcm (const std::string stype, const std::string myName, const std::string myPath) throw (LCMexception)
 
 Clcm (const std::string stype, ClcmPtr myClcm) throw (LCMexception)
 
 Clcm (lcm *mylcm, const int_32 type, const int_32 access, const std::string OSname)
 
 ~Clcm ()
 
void expor (const std::string stype)
 
void expor (const std::string stype, const std::string new_name)
 
void except ()
 
std::string getName () throw ()
 
std::string getPath () throw ()
 
int_32 getType () throw ()
 
int_32 getLength () throw (LCMexception)
 
std::string getDirectory () throw (LCMexception)
 
int_32 getAccess () throw (LCMexception)
 
int_32 getLrda () throw ()
 
int_32 getVersion () throw ()
 
bool isEmpty () throw (LCMexception)
 
bool isNew () throw ()
 
void open (const std::string saccess) throw (LCMexception)
 
void close (const std::string saccess) throw (LCMexception)
 
int_32 length (const std::string key) throw (LCMexception)
 
int_32 length (const int_32 iset) throw (LCMexception)
 
int_32 type (const std::string key) throw (LCMexception)
 
int_32 type (const int_32 iset) throw (LCMexception)
 
void lib () throw (LCMexception)
 
void val () throw (LCMexception)
 
ClcmPtr setDictionary (const std::string key) throw (LCMexception)
 
ClcmPtr setDictionary (const int_32 iset) throw (LCMexception)
 
ClcmPtr setList (const std::string key, const int_32 ilong) throw (LCMexception)
 
ClcmPtr setList (const int_32 iset, const int_32 ilong) throw (LCMexception)
 
ClcmPtr getClcm (const std::string key) throw (LCMexception)
 
ClcmPtr getClcm (const int_32 iset) throw (LCMexception)
 
IntPtrConst getInt (const std::string key) throw (LCMexception)
 
IntPtrConst getInt (const int_32 iset) throw (LCMexception)
 
FloatPtrConst getFloat (const std::string key) throw (LCMexception)
 
FloatPtrConst getFloat (const int_32 iset) throw (LCMexception)
 
StringPtrConst getString (const std::string key) throw (LCMexception)
 
StringPtrConst getString (const int_32 iset) throw (LCMexception)
 
StringVecPtr getVecString (const std::string key, const int_32 size) throw (LCMexception)
 
StringVecPtr getVecString (const int_32 iset, const int_32 size) throw (LCMexception)
 
DoublePtrConst getDouble (const std::string key) throw (LCMexception)
 
DoublePtrConst getDouble (const int_32 iset) throw (LCMexception)
 
BoolPtrConst getBool (const std::string key) throw (LCMexception)
 
BoolPtrConst getBool (const int_32 iset) throw (LCMexception)
 
ComplexPtrConst getComplex (const std::string key) throw (LCMexception)
 
ComplexPtrConst getComplex (const int_32 iset) throw (LCMexception)
 
StringVecPtr keys () throw (LCMexception)
 
void put (const std::string key, IntPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const int_32 iset, IntPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const std::string key, FloatPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const int_32 iset, FloatPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const std::string key, StringPtr myArray) throw (LCMexception)
 
void put (const int_32 iset, StringPtr myArray) throw (LCMexception)
 
void put (const std::string key, StringVecPtr myArray) throw (LCMexception)
 
void put (const int_32 iset, StringVecPtr myArray) throw (LCMexception)
 
void put (const std::string key, DoublePtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const int_32 iset, DoublePtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const std::string key, BoolPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const int_32 iset, BoolPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const std::string key, ComplexPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const int_32 iset, ComplexPtr myArray, const int_32 myLength) throw (LCMexception)
 
void put (const std::string key, ClcmPtr myClcm) throw (LCMexception)
 
void put (const int_32 iset, ClcmPtr myClcm) throw (LCMexception)
 
lcm * extract ()
 

Friends

std::ostream & operator<< (std::ostream &s, ClcmPtr myClcm) throw (LCMexception)
 

Detailed Description

This class is an implementation of the C++/Boost bindings for LCM. LCM capabilities are available for a program written in C++ by using methods belonging to the Clcm class. These methods encapsulate the LCM C API calls used as "extern"C" functions.

A Clcm object in C++ can encapsulate a native LCM object which can be memory-resident or persistent (using the XSM C API) or a file. A LCM or XSM native object can contains dictionaries (aka associative tables or hash tables) and lists.

The Clcm class uses predefined declarations for some datatypes:

#define IntPtr:   boost::shared_array<int_32>
#define FloatPtr:   boost::shared_array<float_32>
#define StringPtr:   boost::shared_ptr<std::string>
#define DoublePtr:   boost::shared_array<double_64>
#define BoolPtr:   boost::shared_array<bool>
#define ComplexPtr:   boost::shared_array< complex<float_32> >
#define StringVecPtr:   boost::shared_ptr< std::vector<std::string> >
#define ClcmPtr:   boost::shared_ptr<Clcm>

Moreover, get 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 StringPtrConst:   boost::shared_ptr<const std::string>
#define DoublePtrConst:   boost::shared_array<const double_64>
#define BoolPtrConst:   boost::shared_array<const bool>
#define ComplexPtrConst:   boost::shared_array<const complex<float_32> >
Author
Alain Hebert, Ecole Polytechnique de Montreal (2010)

Constructor & Destructor Documentation

ganlib::Clcm::Clcm ( const std::string  stype,
const std::string  myName,
const std::string  myPath 
) throw (LCMexception)

Use this constructor to create a Clcm object of a specified type. The new LCM object is open in modification mode and is in a state such that the isNew() method will return true. If a XSM file name exists, the Clcm object is pointing to this file open in "READ-ONLY" mode and is in a state such that the isNew() method will return false. If the type is "LCM_IMP" or "XSM_IMP", the new LCM object is open in modification mode and the isNew() method will return false.

A Clcm object is created using a construct similar to the following one:

ClcmPtr myNewClcm = ClcmPtr(new Clcm("XSM_IMP_ASCII", "Multicompo", "./"));

where a XSM file is imported from ASCII file ./Multicompo.

Parameters
stypetype of the new Clcm object. This variable is chosen among the following values:
"LCM"
memory-resident LCM object
"XSM"
XSM object (or persistent LCM object)
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
"DA"
binary direct-access file (with 128-word records)
"LCM_IMP_BINARY"
memory-resident LCM object constructed by importing from a binary sequential file named "_"+name
"XSM_IMP_BINARY"
XSM object constructed by importing from a binary sequential file named "_"+name
"LCM_IMP_ASCII"
memory-resident LCM object constructed by importing from an ASCII sequential file named "_"+name
"XSM_IMP_ASCII"
XSM object constructed by importing from an ASCII sequential file named "_"+name
myNamecreation name of the new Clcm object
myPathpath to access the associated file. This can be a sequential import file (with "_" prefix), an "XSM", "BINARY", "ASCII" or "DA" file. Set to "./" to work in the current directory.
ganlib::Clcm::Clcm ( const std::string  stype,
ClcmPtr  myClcm 
) throw (LCMexception)

Use this constructor to create a clone of an existing Clcm object. This is a deep-copy operation. A clone is created using the following construct:

ClcmPtr myClcmClone = ClcmPtr(new Clcm("LCM", myClcm));
Parameters
stypetype of the new Clcm object. This variable is chosen among the following values:
"LCM"
memory-resident LCM object
"XSM"
XSM object (or persistent LCM object)
myClcmexisting ClcmPtr object accessed in read-only mode. This object must me of LCM or XSM type.
ganlib::Clcm::Clcm ( lcm *  mylcm,
const int_32  type,
const int_32  access,
const std::string  OSname 
)

Use this constructor to encapsulate an open LCM or XSM object into a Clcm object. The existing LCM or XSM object is not garbage collected (it may belong to another Clcm object).

Parameters
mylcmexisting LCM or XSM object.
typetype of object (=1: LCM; =2:XSM).
accessaccess mode of object (=1: ; =2:).
OSnameoperating system name of object.
ganlib::Clcm::~Clcm ( )

Close and destroy a Clcm object if in modification mode; close and keep a Clcm object if in read-only mode.

Member Function Documentation

void ganlib::Clcm::close ( const std::string  saccess) throw (LCMexception)

Close a Clcm object.

Parameters
saccess="KEEP": close without destruction of the object content; ="DESTROY": close with destruction of the object content.
void ganlib::Clcm::except ( )

Cause an exception (used to debug XABORT in C++).

void ganlib::Clcm::expor ( const std::string  stype)

Serialize and save the object content on a sequential file. This method is not available for file-type Clcm objects. The name of the sequential file is the catenation of "_" with the name of the Clcm object.

Parameters
stypetype of the export file. This variable is chosen among the following values:
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
void ganlib::Clcm::expor ( const std::string  stype,
const std::string  new_name 
)

Serialize and save the object content on a sequential file. This method is not available for file-type Clcm objects.

Parameters
stypetype of the export file. This variable is chosen among the following values:
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
new_namename of the sequential file. This name must begin by character "_".
lcm * ganlib::Clcm::extract ( )

Extract the LCM structure.

Returns
ANSI C pointer of the embedded LCM structure.
int_32 ganlib::Clcm::getAccess ( ) throw (LCMexception)

Return the access type of a Clcm object.

Returns
=0: the object is closed; =1: the object is open in modification mode; =2: the object is open in read-only mode.
BoolPtrConst ganlib::Clcm::getBool ( const std::string  key) throw (LCMexception)

Recover a boolean array from a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getBool. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the boolean array in the dictionary
Returns
array of boolean values stored as BoolPtr object.
BoolPtrConst ganlib::Clcm::getBool ( const int_32  iset) throw (LCMexception)

Recover a boolean array from a list-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getBool. This method is not available for file-type Clcm objects.

Parameters
isetindex of the boolean array in the list. The first list element is stored at index 0.
Returns
array of boolean values stored as BoolPtr object.
ClcmPtr ganlib::Clcm::getClcm ( const std::string  key) throw (LCMexception)

Recover a daughter Clcm object from an existing dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the daughter Clcm object in the dictionary
Returns
daughter ClcmPtr object of dictionary or list type.
ClcmPtr ganlib::Clcm::getClcm ( const int_32  iset) throw (LCMexception)

Recover a daughter Clcm object from an existing list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the daughter Clcm object in the list. The first list element is stored at index 0.
Returns
daughter ClcmPtr object of dictionary or list type.
ComplexPtrConst ganlib::Clcm::getComplex ( const std::string  key) throw (LCMexception)

Recover a complex array from a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getComplex. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the complex array in the dictionary
Returns
array of complex values stored as ComplexPtr object.
ComplexPtrConst ganlib::Clcm::getComplex ( const int_32  iset) throw (LCMexception)

Recover a complex array from a list-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getComplex. This method is not available for file-type Clcm objects.

Parameters
isetindex of the complex array in the list. The first list element is stored at index 0.
Returns
array of complex values stored as ComplexPtr object.
string ganlib::Clcm::getDirectory ( ) throw (LCMexception)

Return the name of the accessible directory of a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Returns
="/" for a dictionary on root or name of the accessible directory.
DoublePtrConst ganlib::Clcm::getDouble ( const std::string  key) throw (LCMexception)

Recover a double precision real array from a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getDouble. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the double precision array in the dictionary
Returns
array of double precision real values stored as DoublePtr object.
DoublePtrConst ganlib::Clcm::getDouble ( const int_32  iset) throw (LCMexception)

Recover a double precision real array from a list-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getDouble. This method is not available for file-type Clcm objects.

Parameters
isetindex of the double precision array in the list. The first list element is stored at index 0.
Returns
array of double precision real values stored as DoublePtr object.
FloatPtrConst ganlib::Clcm::getFloat ( const std::string  key) throw (LCMexception)

Recover a single precision real array from a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getFloat. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the real array in the dictionary
Returns
array of single precision real values stored as FloatPtr object.
FloatPtrConst ganlib::Clcm::getFloat ( const int_32  iset) throw (LCMexception)

Recover a single precision real array from a list-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getFloat. This method is not available for file-type Clcm objects.

Parameters
isetindex of the real array in the list. The first list element is stored at index 0.
Returns
array of single precision real values stored as FloatPtr object.
IntPtrConst ganlib::Clcm::getInt ( const std::string  key) throw (LCMexception)

Recover an integer array from a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getInt. This method is not available for file-type Clcm objects.

Example: An integer array named "myArray" is read from Clcm object named multicompo using

 IntPtrConst ia = multicompo->getInt("myArray");
 for(int i = 0; i < multicompo->length("myArray"); ++i) 
    cout << "ia(" << i << ")=" << ia[i] << endl;
Parameters
keykey identification of the integer array in the dictionary
Returns
array of integer values stored as IntPtr object.
IntPtrConst ganlib::Clcm::getInt ( const int_32  iset) throw (LCMexception)

Recover an integer array from a list-type Clcm object. General rule: Never try to modify, deallocate or free the object returned by getInt. This method is not available for file-type Clcm objects.

Parameters
isetindex of the integer array in the list. The first list element is stored at index 0.
Returns
array of integer values stored as IntPtr object.
int_32 ganlib::Clcm::getLength ( ) throw (LCMexception)

Return the length of a list-type Clcm object. This method is not available for file-type Clcm objects.

Returns
=-1: dictionary; >=1: length of the list-type Clcm object.
int_32 ganlib::Clcm::getLrda ( ) throw ()

Return the number of words in a record of a direct access-type Clcm object.

string ganlib::Clcm::getName ( ) throw ()

Return the name of the Clcm object.

string ganlib::Clcm::getPath ( ) throw ()

Return the path to access the associated file.

StringPtrConst ganlib::Clcm::getString ( const std::string  key) throw (LCMexception)

Recover a string pointer from a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the string returned by getString. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the character array in the dictionary
Returns
character information stored as StringPtr object.
StringPtrConst ganlib::Clcm::getString ( const int_32  iset) throw (LCMexception)

Recover a string pointer from a list-type Clcm object. General rule: Never try to modify, deallocate or free the string returned by getString. This method is not available for file-type Clcm objects.

Parameters
isetindex of the integer array in the list. The first list element is stored at index 0.
Returns
character information stored as StringPtr object.
int_32 ganlib::Clcm::getType ( ) throw ()

Return the type of the Clcm object.

Returns
=1: memory-resident LCM object; =2: persistent LCM object; =3: binary sequential file; =4: ASCII sequential file; =5 binary direct-access file.
StringVecPtr ganlib::Clcm::getVecString ( const std::string  key,
const int_32  size 
) throw (LCMexception)

Recover a vector-of-string pointer from a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the vector-of-string returned by getVecString. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the character array in the dictionary
sizenumber of components in the vector-of-string
Returns
vector-of-string containing the character information stored as StringVecPtr object.
StringVecPtr ganlib::Clcm::getVecString ( const int_32  iset,
const int_32  size 
) throw (LCMexception)

Recover a vector-of-string pointer from a list-type Clcm object. General rule: Never try to modify, deallocate or free the vector-of-string returned by getVecString. This method is not available for file-type Clcm objects.

Parameters
isetindex of the integer array in the list. The first list element is stored at index 0.
sizenumber of components in the vector-of-string
Returns
vector-of-string containing the character information stored as StringVecPtr object.
int_32 ganlib::Clcm::getVersion ( ) throw ()

Return the original version of the imported object.

bool ganlib::Clcm::isEmpty ( ) throw (LCMexception)

Return true if the a dictionary-type Clcm object is empty. This method is not available for file-type Clcm objects.

bool ganlib::Clcm::isNew ( ) throw ()

Return true if the dictionary-type Clcm object is new. This method is not available for file-type Clcm objects.

StringVecPtr ganlib::Clcm::keys ( ) throw (LCMexception)

Recover a vector-of-string pointer containing the keys of a dictionary-type Clcm object. General rule: Never try to modify, deallocate or free the vector-of-string returned by keys. This method is not available for file-type or list-type Clcm objects.

Returns
StringVecPtr of a vector-of-string containing the dictionary keys
int_32 ganlib::Clcm::length ( const std::string  key) throw (LCMexception)

Return the length of a block of information in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the block in the dictionary
Returns
the number of components for an elementary block; -1 for a daughter dictionary; 0: the block does't exist; length of the list for a daughter list; length in characters for a string array.
int_32 ganlib::Clcm::length ( const int_32  iset) throw (LCMexception)

Return the length of a block of information in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the block in the list. The first list element is stored at index 0.
Returns
the number of components for an elementary block; -1 for a daughter dictionary; 0: the block does't exist; length of the list for a daughter list; length in characters for a string array.
void ganlib::Clcm::lib ( ) throw (LCMexception)

Print the table of contents of a dictionary- or list-type Clcm object. This method is not available for file-type Clcm objects.

void ganlib::Clcm::open ( const std::string  saccess) throw (LCMexception)

Open a new Clcm object or reopen an existing Clcm object already closed by the close("KEEP") method. In this case, the Clcm object is reopen in a state such as the isNew() method will return false.

Parameters
saccesstype of open. This variable is chosen among the following values:
"NEW"
open a new Clcm object.
"READ/WRITE"
open in modification mode.
"READ-ONLY"
open in read-only mode.
void ganlib::Clcm::put ( const std::string  key,
IntPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store an integer array in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Example: An integer array named "myIntArray" is inserted in Clcm object named multicompo using

 static int_32 myStaticArray[] = {33, 22, 11, 89};
 IntPtr myIntPtr = IntPtr(new int_32[4]);
 for(int i = 0; i < 4; ++i) myIntPtr[i] = myStaticArray[i];
 multicompo->put("myIntArray", myIntPtr, 4);
Parameters
keykey identification of the block in the dictionary
myArrayinteger array stored as IntPtr object.
myLengthnumber of components in integer array.
void ganlib::Clcm::put ( const int_32  iset,
IntPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store an integer array in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the integer array in the list. The first list element is stored at index 0.
myArrayinteger array stored as IntPtr object.
myLengthnumber of components in integer array.
void ganlib::Clcm::put ( const std::string  key,
FloatPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a single precision real array in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the block in the dictionary
myArraysingle precision real array stored as FloatPtr object.
myLengthnumber of components in real array.
void ganlib::Clcm::put ( const int_32  iset,
FloatPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a single precision real array in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the real array in the list. The first list element is stored at index 0.
myArraysingle precision real array stored as FloatPtr object.
myLengthnumber of components in real array.
void ganlib::Clcm::put ( const std::string  key,
StringPtr  myArray 
) throw (LCMexception)

Store a string pointer in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the character array in the dictionary
myArraycharacter information stored as StringPtr object.
void ganlib::Clcm::put ( const int_32  iset,
StringPtr  myArray 
) throw (LCMexception)

Store a string pointer in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the string in the list. The first list element is stored at index 0.
myArraycharacter information stored as StringPtr object.
void ganlib::Clcm::put ( const std::string  key,
StringVecPtr  myArray 
) throw (LCMexception)

Store a vector-of-string pointer in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the character array in the dictionary
myArrayvector-of-string containing the character information stored as StringVecPtr object.
void ganlib::Clcm::put ( const int_32  iset,
StringVecPtr  myArray 
) throw (LCMexception)

Store a vector-of-string pointer in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the character array in the list. The first list element is stored at index 0.
myArrayvector-of-string containing the character information stored as StringVecPtr object.
void ganlib::Clcm::put ( const std::string  key,
DoublePtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a double precision real array in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the double precision array in the dictionary
myArraydouble precision array stored as DoublePtr object.
myLengthnumber of components in double precision array.
void ganlib::Clcm::put ( const int_32  iset,
DoublePtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a double precision real array in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the double precision array in the list. The first list element is stored at index 0.
myArraydouble precision array stored as DoublePtr object.
myLengthnumber of components in double precision array.
void ganlib::Clcm::put ( const std::string  key,
BoolPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a boolean array in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the block in the dictionary
myArrayboolean array stored as BoolPtr object.
myLengthnumber of components in boolean array.
void ganlib::Clcm::put ( const int_32  iset,
BoolPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a boolean array in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the boolean array in the list. The first list element is stored at index 0.
myArrayboolean array stored as BoolPtr object.
myLengthnumber of components in boolean array.
void ganlib::Clcm::put ( const std::string  key,
ComplexPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a complex array in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Example: A complex array named "myComplArray" is inserted in Clcm object named multicompo using

 ComplexPtr myComplexPtr = ComplexPtr(new complex<float_32>[2]);
 myComplexPtr[0] = complex<float_32>(3.3, 8.9);
 myComplexPtr[1] = complex<float_32>(-3.3, 7.9);
 multicompo->put("myComplArray", myComplexPtr, 2);
Parameters
keykey identification of the block in the dictionary
myArraycomplex array stored as ComplexPtr object.
myLengthnumber of components in complex array.
void ganlib::Clcm::put ( const int_32  iset,
ComplexPtr  myArray,
const int_32  myLength 
) throw (LCMexception)

Store a complex array in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the complex array in the list. The first list element is stored at index 0.
myArraycomplex array stored as ComplexPtr object.
myLengthnumber of components in complex array.
void ganlib::Clcm::put ( const std::string  key,
ClcmPtr  myClcm 
) throw (LCMexception)

Store a daughter Clcm object in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the block in the dictionary
myClcmdaughter Clcm object.
void ganlib::Clcm::put ( const int_32  iset,
ClcmPtr  myClcm 
) throw (LCMexception)

Store a daughter Clcm object in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the complex array in the list. The first list element is stored at index 0.
myClcmdaughter Clcm object.
ClcmPtr ganlib::Clcm::setDictionary ( const std::string  key) throw (LCMexception)

Set a daughter dictionary-type Clcm object from a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the daughter Clcm object in the dictionary
Returns
daughter ClcmPtr object of dictionary or list type.
ClcmPtr ganlib::Clcm::setDictionary ( const int_32  iset) throw (LCMexception)

Set a daughter dictionary-type Clcm object from a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the daughter Clcm object in the list. The first list element is stored at index 0.
Returns
daughter ClcmPtr object of dictionary or list type.
ClcmPtr ganlib::Clcm::setList ( const std::string  key,
const int_32  ilong 
) throw (LCMexception)

Set a daughter list-type Clcm object from a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the daughter Clcm object in the dictionary
ilonginitial length of the heterogeneous list
Returns
daughter ClcmPtr object of dictionary or list type.
ClcmPtr ganlib::Clcm::setList ( const int_32  iset,
const int_32  ilong 
) throw (LCMexception)

Set a daughter list-type Clcm object from a list-type Clcm object This method is not available for file-type Clcm objects.

Parameters
isetindex of the daughter Clcm object in the list. The first list element is stored at index 0.
ilonginitial length of the heterogeneous list
Returns
daughter ClcmPtr object of dictionary or list type.
int_32 ganlib::Clcm::type ( const std::string  key) throw (LCMexception)

Return the type of a block of information in a dictionary-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
keykey identification of the block in the dictionary
Returns
=0: dictionary; =1: integer (int_32); =2: real number (float); =3: string; =4: real number (double); =5: boolean; =6: Complex object; =10: list.
int_32 ganlib::Clcm::type ( const int_32  iset) throw (LCMexception)

Return the type of a block of information in a list-type Clcm object. This method is not available for file-type Clcm objects.

Parameters
isetindex of the block in the list. The first list element is stored at index 0.
Returns
=0: dictionary; =1: integer (int_32); =2: real number (float); =3: string; =4: real number (double); =5: boolean; =6: Complex object; =10: list.
void ganlib::Clcm::val ( ) throw (LCMexception)

Validate a dictionary- or list-type Clcm object. Detect possible memory corruption. This method is not available for file-type Clcm objects.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
ClcmPtr  myClcm 
) throw (LCMexception)
friend

Export a Clcm object into an ostream (ascii stream). This method is not available for file-type Clcm objects. A Clcm object can be dumped to the standard output using:

cout << myClcm;
Parameters
sinitial std::ostream objet.
myClcmClcmPtr object to export.
Returns
final std::ostream objet including the ClcmPtr object.

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