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 #ifndef NVUtil_h
00045 #define NVUtil_h
00046
00047 #include <string>
00048 #include <iostream>
00049 #include <rtm/idl/SDOPackageSkel.h>
00050 #include <rtm/Properties.h>
00051
00052 namespace NVUtil
00053 {
00082 template <class Value>
00083 SDOPackage::NameValue newNV(const char* name, Value value)
00084 {
00085 SDOPackage::NameValue nv;
00086 nv.name = CORBA::string_dup(name);
00087 nv.value <<= value;
00088 return nv;
00089 }
00090
00091
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00149 SDOPackage::NameValue newNVChar(const char* name, const CORBA::Char value);
00150
00151
00175 SDOPackage::NameValue newNVBool(const char* name,
00176 const CORBA::Boolean value);
00177
00178
00202 SDOPackage::NameValue newNVOctet(const char* name, const CORBA::Octet value);
00203
00204 SDOPackage::NameValue newNVAny(const char* name, const CORBA::Any& value);
00205
00206
00207
00231 void copy(SDOPackage::NVList& nv, const RTC::Properties& prop);
00232
00233
00234 RTC::Properties toProperties(const SDOPackage::NVList& nv);
00235
00258 const CORBA::Any& find(const SDOPackage::NVList& nv, const char* name);
00259 const CORBA::Long find_index(const SDOPackage::NVList& nv, const char* name);
00260
00284 bool isString(const SDOPackage::NVList& nv, const char* name);
00285 bool isStringValue(const SDOPackage::NVList& nv, const char* name,
00286 const char* value);
00287
00315 std::string toString(const SDOPackage::NVList& nv, const char* name);
00316
00317
00318
00319 bool appendStringValue(SDOPackage::NVList& nv, const char* name,
00320 const char* value);
00321
00322 void append(SDOPackage::NVList& dest, const SDOPackage::NVList& src);
00323
00324 void dump(SDOPackage::NVList& nv);
00325 };
00326
00327 #endif // NVUtil_h