00001
00020 #ifndef NVUtil_h
00021 #define NVUtil_h
00022
00023 #include <string>
00024 #include <iostream>
00025 #include <rtm/idl/SDOPackageSkel.h>
00026 #include <rtm/Properties.h>
00027
00042 namespace NVUtil
00043 {
00074 template <class Value>
00075 SDOPackage::NameValue newNV(const char* name, Value value)
00076 {
00077 SDOPackage::NameValue nv;
00078 nv.name = CORBA::string_dup(name);
00079 nv.value <<= value;
00080 return nv;
00081 }
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00144 SDOPackage::NameValue newNVChar(const char* name, const CORBA::Char value);
00145
00171 SDOPackage::NameValue newNVBool(const char* name,
00172 const CORBA::Boolean value);
00173
00199 SDOPackage::NameValue newNVOctet(const char* name, const CORBA::Octet value);
00200
00226 SDOPackage::NameValue newNVAny(const char* name, const CORBA::Any& value);
00227
00251 void copyFromProperties(SDOPackage::NVList& nv, const RTC::Properties& prop);
00252
00274 void copyToProperties(RTC::Properties& prop, const SDOPackage::NVList& nv);
00275
00299 RTC::Properties toProperties(const SDOPackage::NVList& nv);
00300
00328 const CORBA::Any& find(const SDOPackage::NVList& nv, const char* name);
00329
00357 const CORBA::Long find_index(const SDOPackage::NVList& nv, const char* name);
00358
00386 bool isString(const SDOPackage::NVList& nv, const char* name);
00387
00419 bool isStringValue(const SDOPackage::NVList& nv, const char* name,
00420 const char* value);
00421
00451 std::string toString(const SDOPackage::NVList& nv, const char* name);
00452
00495 bool appendStringValue(SDOPackage::NVList& nv, const char* name,
00496 const char* value);
00497
00521 void append(SDOPackage::NVList& dest, const SDOPackage::NVList& src);
00522
00546 void dump(SDOPackage::NVList& nv);
00547 };
00548 #endif // NVUtil_h