00001
00020 #ifndef NVUtil_h
00021 #define NVUtil_h
00022
00023 #include <string>
00024 #include <iostream>
00025 #include <rtm/idl/SDOPackageSkel.h>
00026 #include <coil/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
00252 void copyFromProperties(SDOPackage::NVList& nv, const coil::Properties& prop);
00253
00275
00276 void copyToProperties(coil::Properties& prop, const SDOPackage::NVList& nv);
00277
00301
00302 coil::Properties toProperties(const SDOPackage::NVList& nv);
00303
00331 const CORBA::Any& find(const SDOPackage::NVList& nv, const char* name);
00332
00360 const CORBA::Long find_index(const SDOPackage::NVList& nv, const char* name);
00361
00389 bool isString(const SDOPackage::NVList& nv, const char* name);
00390
00422 bool isStringValue(const SDOPackage::NVList& nv, const char* name,
00423 const char* value);
00424
00454 std::string toString(const SDOPackage::NVList& nv, const char* name);
00455
00498 bool appendStringValue(SDOPackage::NVList& nv, const char* name,
00499 const char* value);
00500
00524 void append(SDOPackage::NVList& dest, const SDOPackage::NVList& src);
00525
00549 std::ostream& dump(std::ostream& out, const SDOPackage::NVList& nv);
00550
00551 void dump(const SDOPackage::NVList& nv);
00552
00553 std::string toString(const SDOPackage::NVList& nv);
00554
00555
00556 };
00557 #endif // NVUtil_h