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

#include <Lifo.hxx>

Public Member Functions

 Lifo () throw (LifoException)
 
 ~Lifo () throw (LifoException)
 
void pop () throw (LifoException)
 
void pop (int_32 &myInteger) throw (LifoException)
 
void pop (float_32 &myFloat) throw (LifoException)
 
void pop (std::string &myString) throw (LifoException)
 
void pop (double &myDouble) throw (LifoException)
 
void pop (bool &myBool) throw (LifoException)
 
void pop (ClcmPtr &myClcm) throw (LifoException)
 
void pop (std::string myFile, std::string stype) throw (LifoException)
 
void node (int_32 ipos, int_32 &myInteger) throw (LifoException)
 
void node (int_32 ipos, float_32 &myFloat) throw (LifoException)
 
void node (int_32 ipos, std::string &myString) throw (LifoException)
 
void node (int_32 ipos, double &myDouble) throw (LifoException)
 
void node (int_32 ipos, bool &myBool) throw (LifoException)
 
void node (int_32 ipos, ClcmPtr &myClcm) throw (LifoException)
 
void node (int_32 ipos, std::string node, std::string stype) throw (LifoException)
 
void node (std::string sname, int_32 &myInteger) throw (LifoException)
 
void node (std::string sname, float_32 &myFloat) throw (LifoException)
 
void node (std::string sname, std::string &myString) throw (LifoException)
 
void node (std::string sname, double &myDouble) throw (LifoException)
 
void node (std::string sname, bool &myBool) throw (LifoException)
 
void node (std::string sname, ClcmPtr &myClcm) throw (LifoException)
 
void node (std::string sname, std::string node, std::string stype) throw (LifoException)
 
std::string OSName (std::string sname) throw (LifoException)
 
std::string OSName (int_32 ipos) throw (LifoException)
 
std::string Name (int_32 ipos) throw (LifoException)
 
int_32 typeNode (std::string sname) throw (LifoException)
 
int_32 typeNode (int_32 ipos) throw (LifoException)
 
int_32 accessNode (std::string sname) throw (LifoException)
 
int_32 accessNode (int_32 ipos) throw (LifoException)
 
void push (std::string sname, const int_32 myInteger) throw (LifoException)
 
void push (std::string sname, const float myFloat) throw (LifoException)
 
void push (std::string sname, const std::string myString) throw (LifoException)
 
void push (std::string sname, const double_64 myDouble) throw (LifoException)
 
void push (std::string sname, const bool myBool) throw (LifoException)
 
void push (std::string sname, const ClcmPtr myClcm) throw (LifoException)
 
void push (std::string sname, std::string myFile, std::string stype) throw (LifoException)
 
void push (std::string sname, std::string myFile, std::string stype, std::string OSname) throw (LifoException)
 
void pushEmpty (std::string sname, std::string nodeType) throw (LifoException)
 
void pushEmpty (std::string sname, std::string nodeType, std::string OSname) throw (LifoException)
 
int_32 getMax ()
 
void lib () throw (LifoException)
 
lifo * extract ()
 

Detailed Description

This class is an implementation of the C++/Boost bindings for a last-in-first-out (lifo) stack used with CLE-2000. Lifo management capabilities for a program written in C++ are available by using methods belonging to the Lifo class. These methods encapsulate the lifo API calls used as "extern"C" functions.

A Lifo object in C++ can encapsulate a native lifo stack used to manage CLE-2000 parameters.

A lifo stack can contain defined or undefined (empty) nodes; used to represent known or unknown parameters, respectively.

Note: There is a constraint_32 in CLE-2000. LCM (or XSM) objects and files must be pushed before single-value nodes in the stack.

Author
Alain Hebert, Ecole Polytechnique de Montreal (2012)

Constructor & Destructor Documentation

ganlib::Lifo::Lifo ( ) throw (LifoException)

Use this constructor to create an empty Lifo object.

ganlib::Lifo::~Lifo ( ) throw (LifoException)

Close and destroy a Lifo object.

Member Function Documentation

int_32 ganlib::Lifo::accessNode ( std::string  sname) throw (LifoException)

Return the access of the node associated with a given name. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
Returns
node access (0= creation; 1:modification; 2=read-only).
int_32 ganlib::Lifo::accessNode ( int_32  ipos) throw (LifoException)

Return the access of the node at a given position. The lifo stack is not modified

Parameters
iposnode position in lifo stack
Returns
node access (0= creation; 1:modification; 2=read-only).
lifo * ganlib::Lifo::extract ( )

Extract the lifo structure.

Returns
ANSI C pointer of the embedded lifo structure.
int_32 ganlib::Lifo::getMax ( )

Gives the number of nodes in the lifo stack

Returns
number of nodes in lifo stack
void ganlib::Lifo::lib ( ) throw (LifoException)

Print_32 the table-of-content of a lifo stack

string ganlib::Lifo::Name ( int_32  ipos) throw (LifoException)

Return the name of the node at a given position. The lifo stack is not modified

Parameters
iposnode position in lifo stack
Returns
name of the node
void ganlib::Lifo::node ( int_32  ipos,
int_32 &  myInteger 
) throw (LifoException)

Return the integer value node with a given position. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
iposnode position in lifo stack
myIntegerinteger value node.
void ganlib::Lifo::node ( int_32  ipos,
float_32 &  myFloat 
) throw (LifoException)

Return the real value node with a given position. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
iposnode position in lifo stack
myFloatreal value node.
void ganlib::Lifo::node ( int_32  ipos,
std::string &  myString 
) throw (LifoException)

Return the character string node with a given position. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
iposnode position in lifo stack
myStringcharacter string node (limited to 72 characters).
void ganlib::Lifo::node ( int_32  ipos,
double &  myDouble 
) throw (LifoException)

Return the double precision value node with a given position. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
iposnode position in lifo stack
myDoubledouble precision value node.
void ganlib::Lifo::node ( int_32  ipos,
bool &  myBool 
) throw (LifoException)

Return the boolean value node with a given position. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
iposnode position in lifo stack
myBoolinteger value node.
void ganlib::Lifo::node ( int_32  ipos,
ClcmPtr &  myClcm 
) throw (LifoException)

Return the ClcmPtr object node with a given position. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
iposnode position in lifo stack
myClcmClcmPtr object node.
void ganlib::Lifo::node ( int_32  ipos,
std::string  node,
std::string  stype 
) throw (LifoException)

Return the file object node with a given position. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
iposnode position in lifo stack
nodeoperating system (OS) name (limited to 72 characters) associated to the file object node to pop from the lifo stack.
stypetype of LCM object or file. This variable is selected by pop among the following values:
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
"DA"
binary direct-access file (with 128-word records)
void ganlib::Lifo::node ( std::string  sname,
int_32 &  myInteger 
) throw (LifoException)

Return the integer value node with a given name. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
myIntegerinteger value node.
void ganlib::Lifo::node ( std::string  sname,
float_32 &  myFloat 
) throw (LifoException)

Return the real value node with a given name. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
myFloatreal value node.
void ganlib::Lifo::node ( std::string  sname,
std::string &  myString 
) throw (LifoException)

Return the character string node with a given name. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
myStringcharacter string node (limited to 72 characters).
void ganlib::Lifo::node ( std::string  sname,
double &  myDouble 
) throw (LifoException)

Return the double precision value node with a given name. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
myDoubledouble precision value node.
void ganlib::Lifo::node ( std::string  sname,
bool &  myBool 
) throw (LifoException)

Return the boolean value node with a given name. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
myBoolinteger value node.
void ganlib::Lifo::node ( std::string  sname,
ClcmPtr &  myClcm 
) throw (LifoException)

Return the ClcmPtr object node with a given name. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
myClcmClcmPtr object node.
void ganlib::Lifo::node ( std::string  sname,
std::string  node,
std::string  stype 
) throw (LifoException)

Return the file object node with a given name. If the node is empty or if the argument type is wrong, an exception is thrown. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
nodeoperating system (OS) name (limited to 72 characters) associated to the file object node to pop from the lifo stack.
stypetype of LCM object or file. This variable is selected by pop among the following values:
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
"DA"
binary direct-access file (with 128-word records)
std::string ganlib::Lifo::OSName ( std::string  sname) throw (LifoException)

Return the OSname of the node associated with a given name. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
Returns
OSName of the file
string ganlib::Lifo::OSName ( int_32  ipos) throw (LifoException)

Return the OSname of the node at a given position. The lifo stack is not modified

Parameters
iposnode position in lifo stack
Returns
OSName of the file
void ganlib::Lifo::pop ( ) throw (LifoException)

Pop the value on top of the Lifo stack without recovering it. If the node is empty, an exception is thrown

void ganlib::Lifo::pop ( int_32 &  myInteger) throw (LifoException)

Pop the integer value on top of the Lifo stack. If the node is empty or if the argument type is wrong, an exception is thrown

Parameters
myIntegerinteger value node to pop from the lifo stack.
void ganlib::Lifo::pop ( float_32 &  myFloat) throw (LifoException)

Pop the real value on top of the Lifo stack. If the node is empty or if the argument type is wrong, an exception is thrown

Parameters
myFloatreal value node to pop from the lifo stack.
void ganlib::Lifo::pop ( std::string &  myString) throw (LifoException)

Pop the character string on top of the Lifo stack. If the node is empty or if the argument type is wrong, an exception is thrown

Parameters
myStringcharacter string node (limited to 72 characters) to pop from the lifo stack.
void ganlib::Lifo::pop ( double &  myDouble) throw (LifoException)

Pop the double precision value on top of the Lifo stack. If the node is empty or if the argument type is wrong, an exception is thrown

Parameters
myDoubledouble precision value node to pop from the lifo stack.
void ganlib::Lifo::pop ( bool &  myBool) throw (LifoException)

Pop the boolean value on top of the Lifo stack. If the node is empty or if the argument type is wrong, an exception is thrown

Parameters
myBoolboolean value node to pop from the lifo stack.
void ganlib::Lifo::pop ( ClcmPtr &  myClcm) throw (LifoException)

Pop the ClcmPtr object on top of the Lifo stack. If the node is empty or if the argument type is wrong, an exception is thrown

Parameters
myClcmLCM object node to pop from the lifo stack.
void ganlib::Lifo::pop ( std::string  myFile,
std::string  stype 
) throw (LifoException)

Pop the file object on top of the Lifo stack. If the node is empty or if the argument type is wrong, an exception is thrown

Parameters
myFileoperating system (OS) name (limited to 72 characters) associated to the file object node to pop from the lifo stack.
stypetype of file. This variable is selected by pop among the following values:
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
"DA"
binary direct-access file (with 128-word records)
void ganlib::Lifo::push ( std::string  sname,
const int_32  myInteger 
) throw (LifoException)

Push a new integer on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myIntegerinteger value to push into the lifo stack
void ganlib::Lifo::push ( std::string  sname,
const float  myFloat 
) throw (LifoException)

Push a new real on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myFloatreal value to push into the lifo stack
void ganlib::Lifo::push ( std::string  sname,
const std::string  myString 
) throw (LifoException)

Push a new node object on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myStringstring object to push into the lifo stack.
void ganlib::Lifo::push ( std::string  sname,
const double_64  myDouble 
) throw (LifoException)

Push a new double precision value on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myDoubledouble precision value to push into the lifo stack
void ganlib::Lifo::push ( std::string  sname,
const bool  myBool 
) throw (LifoException)

Push a new boolean value on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myBoolboolean value to push into the lifo stack
void ganlib::Lifo::push ( std::string  sname,
const ClcmPtr  myClcm 
) throw (LifoException)

Push a new ClcmPtr node object on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myClcmClcmPtr LCM/XSM object to push into the lifo stack. result
void ganlib::Lifo::push ( std::string  sname,
std::string  myFile,
std::string  stype 
) throw (LifoException)

Push a new node object with a type on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myFilefile object to push into the lifo stack.
stypetype of LCM object or file. This variable is chosen among the following values:
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
"DA"
binary direct-access file (with 128-word records)
void ganlib::Lifo::push ( std::string  sname,
std::string  myFile,
std::string  stype,
std::string  OSname 
) throw (LifoException)

Push a new node object with a type and an "OSname" on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
myFilefile object to push into the lifo stack.
stypetype of LCM object or file. This variable is chosen among the following values:
"BINARY"
binary sequential file
"ASCII"
ACSII sequential file
"DA"
binary direct-access file (with 128-word records)
OSnameoperating system (OS) name associated to the file (limited to 72 characters).
void ganlib::Lifo::pushEmpty ( std::string  sname,
std::string  nodeType 
) throw (LifoException)

Push an empty node on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
nodeTypenode type (='I': integer value; 'F': real value; 'D': double precision value; 'B': boolean value;'S': character string value; ='LCM': memory-resident LCM object; ='XSM': XSM file; ='BINARY': binary file; ='ASCII': ascii file; ='DA': direct-access file (with 128-word records))
void ganlib::Lifo::pushEmpty ( std::string  sname,
std::string  nodeType,
std::string  OSname 
) throw (LifoException)

Push an empty node on top of the Lifo stack

Parameters
snamenode name (limited to 12 characters)
nodeTypenode type (='XSM': XSM file; ='BINARY': binary file; ='ASCII': ascii file; ='DA': direct-access file (with 128-word records))
OSnameoperating system (OS) name associated to the file (limited to 72 characters).
int_32 ganlib::Lifo::typeNode ( std::string  sname) throw (LifoException)

Return the type of the node associated with a given name. The lifo stack is not modified

Parameters
snamenode name (limited to 12 characters)
Returns
node type (3= LCM object; 4= XSM file; 5= seq binary; 6= seq ascii; 7= DA binary; 11= integer value; 12= real value; 13= character std::string; 14= double precision value; 15= logical value). A negative value indicates an empty node.
int_32 ganlib::Lifo::typeNode ( int_32  ipos) throw (LifoException)

Return the type of the node at a given position. The lifo stack is not modified

Parameters
iposnode position in lifo stack
Returns
node type (3= LCM object; 4= XSM file; 5= seq binary; 6= seq ascii; 7= DA binary; 11= integer value; 12= real value; 13= character std::string; 14= double precision value; 15= logical value). A negative value indicates an empty node.

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