CNameValuePairList Class Reference

This class handles a list of name/value pairs. It handles a (hidden) map associating string keys to string values.This class avoids the need to include stl's map header file in the C++ interface, thus preventing potential compile/link errors when dynamically loading modules. More...

Public Member Functions

OpenViBE::boolean setValue (const OpenViBE::CString &rName, const OpenViBE::CString &rValue)
 Insert a name/value pair. More...
 
OpenViBE::boolean setValue (const OpenViBE::CString &rName, const char *pValue)
 Insert a name/value pair. More...
 
OpenViBE::boolean setValue (const OpenViBE::CString &rName, const OpenViBE::float64 &rValue)
 Insert a name/value pair where value is a float64. More...
 
OpenViBE::boolean setValue (const OpenViBE::CString &rName, OpenViBE::boolean bValue)
 Insert a name/value pair where value is a boolean. More...
 
OpenViBE::boolean getValue (const OpenViBE::CString &rName, OpenViBE::CString &rValue) const
 Retrieve a value from the list. More...
 
OpenViBE::boolean getValue (const OpenViBE::CString &rName, OpenViBE::float64 &rValue) const
 Retrieve a float64 value from the list. More...
 
OpenViBE::boolean getValue (const OpenViBE::CString &rName, OpenViBE::boolean &rValue) const
 Retrieve a boolean value from the list In the current implementation a value evaluates to true if its string equals "1" and to false if it equals "0". More...
 
Constructor / Destructor
 CNameValuePairList (void)
 Default constructor. More...
 
 CNameValuePairList (const OpenViBE::CNameValuePairList &rNameValuePairList)
 Copy constructor. More...
 
virtual ~CNameValuePairList (void)
 Destructor. More...
 
Operators
OpenViBE::CNameValuePairListoperator= (const OpenViBE::CNameValuePairList &rNameValuePairList)
 Affectation operator (copy) More...
 

Protected Attributes

OpenViBE::CNameValuePairListImpl * m_pNameValuePairListImpl
 The list implementation.
 

Detailed Description

This class handles a list of name/value pairs. It handles a (hidden) map associating string keys to string values.

This class avoids the need to include stl's map header file in the C++ interface, thus preventing potential compile/link errors when dynamically loading modules.

Author
Vincent Delannoy (INRIA/IRISA)
Date
2008-07
Note
Implementation based on std::map<std::string, std::string>

Constructor & Destructor Documentation

CNameValuePairList ( void  )

Default constructor.

Initializes the list.

CNameValuePairList ( const OpenViBE::CNameValuePairList rNameValuePairList)

Copy constructor.

Parameters
rNameValuePairList[in] : The list to copy

Copies the contents of rNameValuePairList into the new list.

virtual ~CNameValuePairList ( void  )
virtual

Destructor.

The destructor releases the std::map implementation !

Member Function Documentation

OpenViBE::CNameValuePairList& operator= ( const OpenViBE::CNameValuePairList rNameValuePairList)

Affectation operator (copy)

Parameters
rNameValuePairList[in] : The list to copy
Returns
This list.
OpenViBE::boolean setValue ( const OpenViBE::CString rName,
const OpenViBE::CString rValue 
)

Insert a name/value pair.

Parameters
[in]rNameName to add to the list
[in]rValueValue to associate with the name
Returns
True if pair could be inserted, false otherwise
OpenViBE::boolean setValue ( const OpenViBE::CString rName,
const char *  pValue 
)

Insert a name/value pair.

Parameters
[in]rNameName to add to the list
[in]pValueValue to associate with the name
Returns
True if pair could be inserted, false otherwise
OpenViBE::boolean setValue ( const OpenViBE::CString rName,
const OpenViBE::float64 &  rValue 
)

Insert a name/value pair where value is a float64.

Parameters
[in]rNameName to add to the list
[in]rValueFloat64 value to associate with the name
Returns
True if pair could be inserted, false otherwise
OpenViBE::boolean setValue ( const OpenViBE::CString rName,
OpenViBE::boolean  bValue 
)

Insert a name/value pair where value is a boolean.

Parameters
[in]rNameName to add to the list
[in]bValueBoolean value to associate with the name
Returns
True if pair could be inserted, false otherwise
OpenViBE::boolean getValue ( const OpenViBE::CString rName,
OpenViBE::CString rValue 
) const

Retrieve a value from the list.

Parameters
[in]rNameName whose value is to be retrieved
[out]rValueValue to be retrieved from the list
Returns
True if value could be retrieved, false otherwise
OpenViBE::boolean getValue ( const OpenViBE::CString rName,
OpenViBE::float64 &  rValue 
) const

Retrieve a float64 value from the list.

Parameters
[in]rNameName whose value is to be retrieved
[out]rValueFloat64 value to be retrieved
Returns
True if a float64 value could be retrieved, false otherwise
OpenViBE::boolean getValue ( const OpenViBE::CString rName,
OpenViBE::boolean &  rValue 
) const

Retrieve a boolean value from the list In the current implementation a value evaluates to true if its string equals "1" and to false if it equals "0".

Parameters
rValueString to evaluate
Returns
True if string evaluates to a boolean, false otherwise