00001
00020 #ifndef NVUTIL_NVUTIL_H
00021 #define NVUTIL_NVUTIL_H
00022
00023 #include <string>
00024 #include <iostream>
00025 #include <coil/Properties.h>
00026 #include <rtm/idl/SDOPackageSkel.h>
00027
00046 namespace NVUtil
00047 {
00078 template <class Value>
00079 SDOPackage::NameValue newNV(const char* name, Value value)
00080 {
00081 SDOPackage::NameValue nv;
00082 nv.name = CORBA::string_dup(name);
00083 nv.value <<= value;
00084 return nv;
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
00119
00120
00121
00122
00148 SDOPackage::NameValue newNVChar(const char* name, const CORBA::Char value);
00149
00175 SDOPackage::NameValue newNVBool(const char* name,
00176 const CORBA::Boolean value);
00177
00203 SDOPackage::NameValue newNVOctet(const char* name, const CORBA::Octet value);
00204
00230 SDOPackage::NameValue newNVAny(const char* name, const CORBA::Any& value);
00231
00255 void copyFromProperties(SDOPackage::NVList& nv, const coil::Properties& prop);
00256
00278 void copyToProperties(coil::Properties& prop, const SDOPackage::NVList& nv);
00279
00303 coil::Properties toProperties(const SDOPackage::NVList& nv);
00304
00332 const CORBA::Any& find(const SDOPackage::NVList& nv, const char* name);
00333
00361 const CORBA::Long find_index(const SDOPackage::NVList& nv, const char* name);
00362
00390 bool isString(const SDOPackage::NVList& nv, const char* name);
00391
00423 bool isStringValue(const SDOPackage::NVList& nv, const char* name,
00424 const char* value);
00425
00455 std::string toString(const SDOPackage::NVList& nv, const char* name);
00456
00499 bool appendStringValue(SDOPackage::NVList& nv, const char* name,
00500 const char* value);
00501
00525 void append(SDOPackage::NVList& dest, const SDOPackage::NVList& src);
00526
00550 std::ostream& dump(std::ostream& out, const SDOPackage::NVList& nv);
00551
00562 void dump(const SDOPackage::NVList& nv);
00563
00573 std::string toString(const SDOPackage::NVList& nv);
00574
00575
00576 };
00577 #endif // NVUTIL_NVUTIL_H