OpenRTM-aist  1.2.1
Functions
NVUtil Namespace Reference

Utility for NameValue. More...

Functions

template<class Value >
SDOPackage::NameValue newNV (const char *name, Value value)
 Create NameValue. More...
 
SDOPackage::NameValue newNVChar (const char *name, const CORBA::Char value)
 Create NameValue typed CORBA::Char. More...
 
SDOPackage::NameValue newNVBool (const char *name, const CORBA::Boolean value)
 Create NameValue typed CORBA::Boolean. More...
 
SDOPackage::NameValue newNVOctet (const char *name, const CORBA::Octet value)
 Create NameValue typed CORBA::Octet. More...
 
SDOPackage::NameValue newNVAny (const char *name, const CORBA::Any &value)
 Create NameValue typed CORBA::Any. More...
 
void copyFromProperties (SDOPackage::NVList &nv, const coil::Properties &prop)
 Copy the properties to NVList. More...
 
void copyToProperties (coil::Properties &prop, const SDOPackage::NVList &nv)
 Copy NVList to the Proeprties. More...
 
coil::Properties toProperties (const SDOPackage::NVList &nv)
 Transform NVList to the properties. More...
 
const CORBA::Any & find (const SDOPackage::NVList &nv, const char *name)
 Return the value specified by name from NVList. More...
 
const CORBA::Long find_index (const SDOPackage::NVList &nv, const char *name)
 Return the index of element specified by name from NVList. More...
 
bool isString (const SDOPackage::NVList &nv, const char *name)
 Validate whether value type specified by name is string type. More...
 
bool isStringValue (const SDOPackage::NVList &nv, const char *name, const char *value)
 Check whether the value of specified name matches the specified string. More...
 
std::string toString (const SDOPackage::NVList &nv, const char *name)
 Get NVList of specifid name as string. More...
 
bool appendStringValue (SDOPackage::NVList &nv, const char *name, const char *value)
 Append the specified string to element of NVList. More...
 
void append (SDOPackage::NVList &dest, const SDOPackage::NVList &src)
 Append an element to NVList. More...
 
std::ostream & dump_to_stream (std::ostream &out, const SDOPackage::NameValue &nv)
 Print information configured in NameValue as string type. More...
 
std::ostream & operator<< (std::ostream &os, const SDOPackage::NameValue &nv)
 
std::ostream & operator<< (std::ostream &os, const SDOPackage::NVList &nvlist)
 Print information configured in NVList as string type. More...
 
std::ostream & dump (std::ostream &out, const SDOPackage::NVList &nv)
 Print information configured in NVList as string type. More...
 
void dump (const SDOPackage::NVList &nv)
 Print information configured in NVList as a string type to Standard Outport. More...
 
std::string toString (const SDOPackage::NVList &nv)
 Get information configured in NVList as a string type. More...
 

Detailed Description

Utility for NameValue.

This class provides the utility function of NameValue.

Function Documentation

void NVUtil::append ( SDOPackage::NVList &  dest,
const SDOPackage::NVList &  src 
)

Append an element to NVList.

This operation appends elements specified by src to NVList specified by dest.

Parameters
destNVList to be appended
srcNVList to append

Referenced by newNV().

bool NVUtil::appendStringValue ( SDOPackage::NVList &  nv,
const char *  name,
const char *  value 
)

Append the specified string to element of NVList.

This operation appends the string value specified by value to the element specified by name. Operate nothing when the 'value' value has already been set to the element specified by name. Add the 'value' value each separating by a comma "," when the 'value' value is not set to the element specified by name. Set the specified value. Add a new element at the end of NVList, and set the specified value, when the element specified by name does not exist.

Parameters
nvThe target NVList for the search
nameThe target element name for the appending
valueString to append
Returns
Append operation result

Referenced by RTC::PortBase::appendProperty(), and newNV().

void NVUtil::copyFromProperties ( SDOPackage::NVList &  nv,
const coil::Properties prop 
)

Copy the properties to NVList.

This operation copies the properties to NVList. All NVList's values are copied as CORBA::string.

Parameters
nvNVList to store properties values
propProperties that is copies from

Referenced by newNV().

void NVUtil::copyToProperties ( coil::Properties prop,
const SDOPackage::NVList &  nv 
)

Copy NVList to the Proeprties.

This operation copies NVList to properties.

Parameters
propProperties to store NVList values
nvNVList of copy source

Referenced by newNV().

std::ostream& NVUtil::dump ( std::ostream &  out,
const SDOPackage::NVList &  nv 
)

Print information configured in NVList as string type.

Print configured information as string type in specified NVList. Also, print the reason (this is not string type) if the configured element is other than string type.

Parameters
nvThe target NVList for the print

Referenced by newNV().

void NVUtil::dump ( const SDOPackage::NVList &  nv)

Print information configured in NVList as a string type to Standard Outport.

Parameters
nvThe target NVList for the print
std::ostream& NVUtil::dump_to_stream ( std::ostream &  out,
const SDOPackage::NameValue &  nv 
)

Print information configured in NameValue as string type.

Print configured information as string type in specified NVList. Also, print the reason (this is not string type) if the configured element is other than string type.

Parameters
nvThe target NameValue for the print

Referenced by newNV().

const CORBA::Any& NVUtil::find ( const SDOPackage::NVList &  nv,
const char *  name 
)

Return the value specified by name from NVList.

This operation returns Any type of value specified by name. When an element of specified name doesn't exist, the exception will occur.

Parameters
nvThe target NVList for the find
nameName for the find
Returns
Find result

Referenced by newNV().

const CORBA::Long NVUtil::find_index ( const SDOPackage::NVList &  nv,
const char *  name 
)

Return the index of element specified by name from NVList.

This operation returns the index at the position where the element specified by name is stored.

Parameters
nvThe target NVList for the find
nameName for the find
Returns
Index of target object for the find

Referenced by newNV().

bool NVUtil::isString ( const SDOPackage::NVList &  nv,
const char *  name 
)

Validate whether value type specified by name is string type.

This operation returns the bool value by checking whether the type of value specified with name is CORBA::string.

Parameters
nvThe target NVList for the search
nameName for the search
Returns
String validation result (String:true, Else:false)

Referenced by newNV().

bool NVUtil::isStringValue ( const SDOPackage::NVList &  nv,
const char *  name,
const char *  value 
)

Check whether the value of specified name matches the specified string.

This operation checks whether the value specified with name is CORBA::string and returns the bool value which matches spcified string.

Parameters
nvThe target NVList for the search
nameName for the search
valueString value to compare
Returns
Check result (Match:true, Unmatch:false)

Referenced by newNV().

template<class Value >
SDOPackage::NameValue NVUtil::newNV ( const char *  name,
Value  value 
)

Create NameValue.

This operation creates NameValue. CORBA::Char, CORBA::Boolean, CORBA::Octet creation is not supported. These type of NameValue should be created by using newNVChar(), newNVBool(), newNVOctet() functions.

Parameters
nameName of NameValue
valueThe value of NameValue
Returns
NameValue

References append(), appendStringValue(), copyFromProperties(), copyToProperties(), dump(), dump_to_stream(), find(), find_index(), isString(), isStringValue(), newNVAny(), newNVBool(), newNVChar(), newNVOctet(), operator<<(), toProperties(), and toString().

Referenced by RTC::PortBase::addProperty().

SDOPackage::NameValue NVUtil::newNVAny ( const char *  name,
const CORBA::Any &  value 
)

Create NameValue typed CORBA::Any.

This operation creates NameValue typed CORBA::Any.

Parameters
nameName of NameValue
valueThe value of NameValue
Returns
NameValue

Referenced by newNV().

SDOPackage::NameValue NVUtil::newNVBool ( const char *  name,
const CORBA::Boolean  value 
)

Create NameValue typed CORBA::Boolean.

This operation creates NameValue typed CORBA::Boolean.

Parameters
nameName of NameValue
valueThe value of NameValue
Returns
NameValue

Referenced by newNV().

SDOPackage::NameValue NVUtil::newNVChar ( const char *  name,
const CORBA::Char  value 
)

Create NameValue typed CORBA::Char.

This operation creates NameValue typed CORBA::Char.

Parameters
nameName of NameValue
valueThe value of NameValue
Returns
NameValue

Referenced by newNV().

SDOPackage::NameValue NVUtil::newNVOctet ( const char *  name,
const CORBA::Octet  value 
)

Create NameValue typed CORBA::Octet.

This operation creates NameValue typed CORBA::Octet.

Parameters
nameName of NameValue
valueThe value of NameValue
Returns
NameValue

Referenced by newNV().

std::ostream& NVUtil::operator<< ( std::ostream &  os,
const SDOPackage::NameValue &  nv 
)

Referenced by newNV().

std::ostream& NVUtil::operator<< ( std::ostream &  os,
const SDOPackage::NVList &  nvlist 
)

Print information configured in NVList as string type.

Print configured information as string type in specified NVList. Also, print the reason (this is not string type) if the configured element is other than string type.

Parameters
nvThe target NVList for the print
coil::Properties NVUtil::toProperties ( const SDOPackage::NVList &  nv)

Transform NVList to the properties.

This operation transforms NVList to properties

Parameters
nvNVList of tranformation source
Returns
Transformation result Property

Referenced by newNV().

std::string NVUtil::toString ( const SDOPackage::NVList &  nv,
const char *  name 
)

Get NVList of specifid name as string.

This operation returns string value in NVList specified by name. If the value in NVList specified by name is not CORBA::string type this operation returns empty string value.

Parameters
nvThe target NVList for the search
nameName for the search
Returns
String value corresponding to name

Referenced by newNV().

std::string NVUtil::toString ( const SDOPackage::NVList &  nv)

Get information configured in NVList as a string type.

Parameters
nvThe target NVList for the print