00001
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef NVUtil_h
00048 #define NVUtil_h
00049
00050 #include <string>
00051 #include <iostream>
00052 #include <rtm/idl/SDOPackageSkel.h>
00053 #include <rtm/Properties.h>
00054
00055 namespace NVUtil
00056 {
00085 template <class Value>
00086 SDOPackage::NameValue newNV(const char* name, Value value)
00087 {
00088 SDOPackage::NameValue nv;
00089 nv.name = CORBA::string_dup(name);
00090 nv.value <<= value;
00091 return nv;
00092 }
00093
00094
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00152 SDOPackage::NameValue newNVChar(const char* name, const CORBA::Char value);
00153
00154
00178 SDOPackage::NameValue newNVBool(const char* name,
00179 const CORBA::Boolean value);
00180
00181
00205 SDOPackage::NameValue newNVOctet(const char* name, const CORBA::Octet value);
00206
00207 SDOPackage::NameValue newNVAny(const char* name, const CORBA::Any& value);
00208
00209
00210
00234 void copyFromProperties(SDOPackage::NVList& nv, const RTC::Properties& prop);
00235
00236 void copyToProperties(RTC::Properties& prop, const SDOPackage::NVList& nv);
00237 RTC::Properties toProperties(const SDOPackage::NVList& nv);
00238
00261 const CORBA::Any& find(const SDOPackage::NVList& nv, const char* name);
00262 const CORBA::Long find_index(const SDOPackage::NVList& nv, const char* name);
00263
00287 bool isString(const SDOPackage::NVList& nv, const char* name);
00288 bool isStringValue(const SDOPackage::NVList& nv, const char* name,
00289 const char* value);
00290
00318 std::string toString(const SDOPackage::NVList& nv, const char* name);
00319
00320
00321
00322 bool appendStringValue(SDOPackage::NVList& nv, const char* name,
00323 const char* value);
00324
00325 void append(SDOPackage::NVList& dest, const SDOPackage::NVList& src);
00326
00327 void dump(SDOPackage::NVList& nv);
00328
00329
00330 };
00331
00332 #endif // NVUtil_h