OpenRTM-aist 2.0.2
Loading...
Searching...
No Matches
NVUtil.h
Go to the documentation of this file.
1// -*- C++ -*-
20#ifndef NVUTIL_NVUTIL_H
21#define NVUTIL_NVUTIL_H
22
23#include <coil/Properties.h>
24#include <rtm/idl/SDOPackageSkel.h>
25
26#include <string>
27#include <iostream>
28
47namespace NVUtil
48{
79 template <class Value>
80 SDOPackage::NameValue newNV(const char* name, Value value)
81 {
82 SDOPackage::NameValue nv;
83 nv.name = CORBA::string_dup(name);
84 nv.value <<= value;
85 return nv;
86 }
87
88 /***
89 * @if jp
90 *
91 * @brief value が CORBA::string の NameValue を生成する
92 *
93 * このオペレーションはf value が CORBA::string の NameValueを作成する。
94 *
95 * @param name NameValue の name
96 * @param value NameValue の value
97 *
98 * @return NameValue
99 *
100 * @else
101 *
102 * @brief Create NameValue typed CORBA::string
103 *
104 * This operation creates NameValue typed CORBA::string.
105 *
106 * @param name Name of NameValue
107 * @param value The value of NameValue
108 *
109 * @return NameValue
110 *
111 * @endif
112 */
113 /*
114 template <>
115 SDOPackage::NameValue newNV(const char* name, const char* value)
116 {
117 SDOPackage::NameValue nv;
118 nv.name = CORBA::string_dup(name);
119 nv.value <<= value;
120 return nv;
121 }
122 */
123
149 SDOPackage::NameValue newNVChar(const char* name, CORBA::Char value);
150
176 SDOPackage::NameValue newNVBool(const char* name,
177 CORBA::Boolean value);
178
204 SDOPackage::NameValue newNVOctet(const char* name, CORBA::Octet value);
205
231 SDOPackage::NameValue newNVAny(const char* name, const CORBA::Any& value);
232
256#ifndef ORB_IS_RTORB
257 void copyFromProperties(SDOPackage::NVList& nv, const coil::Properties& prop);
258#else // ORB_IS_RTORB
259 void copyFromProperties(SDOPackage_NVList& nv, const coil::Properties& prop);
260#endif // ORB_IS_RTORB
261
283 void copyToProperties(coil::Properties& prop, const SDOPackage::NVList& nv);
284
308 coil::Properties toProperties(const SDOPackage::NVList& nv);
309
337 const CORBA::Any& find(const SDOPackage::NVList& nv, const char* name);
338
366 CORBA::Long find_index(const SDOPackage::NVList& nv, const char* name);
367
395 bool isString(const SDOPackage::NVList& nv, const char* name);
396
428 bool isStringValue(const SDOPackage::NVList& nv, const char* name,
429 const char* value);
430
460 std::string toString(const SDOPackage::NVList& nv, const char* name);
461
504#ifndef ORB_IS_RTORB
505 bool appendStringValue(SDOPackage::NVList& nv, const char* name,
506 const char* value);
507#else // ORB_IS_RTORB
508 bool appendStringValue(SDOPackage_NVList& nv, const char* name,
509 const char* value);
510#endif // ORB_IS_RTORB
511
535 void append(SDOPackage::NVList& dest, const SDOPackage::NVList& src);
536
560 std::ostream& dump_to_stream(std::ostream& out,
561 const SDOPackage::NameValue& nv);
562 std::ostream& operator<<(std::ostream& os, const SDOPackage::NameValue& nv);
563
587 std::ostream& operator<<(std::ostream& os, const SDOPackage::NVList& nvlist);
588
612 std::ostream& dump(std::ostream& out, const SDOPackage::NVList& nv);
613
628 void dump(const SDOPackage::NVList& nv);
629
643 std::string toString(const SDOPackage::NVList& nv);
644
645
646} // namespace NVUtil
647#endif // NVUTIL_NVUTIL_H
Utility for NameValue.
std::ostream & dump_to_stream(std::ostream &out, const SDOPackage::NameValue &nv)
Print information configured in NameValue as string type.
void copyToProperties(coil::Properties &prop, const SDOPackage::NVList &nv)
Copy NVList to the Proeprties.
coil::Properties toProperties(const SDOPackage::NVList &nv)
Transform NVList to the properties.
std::ostream & dump(std::ostream &out, const SDOPackage::NVList &nv)
Print information configured in NVList as string type.
SDOPackage::NameValue newNVOctet(const char *name, CORBA::Octet value)
Create NameValue typed CORBA::Octet.
CORBA::Long find_index(const SDOPackage::NVList &nv, const char *name)
Return the index of element specified by name from NVList.
bool isString(const SDOPackage::NVList &nv, const char *name)
Validate whether value type specified by name is string type.
SDOPackage::NameValue newNVAny(const char *name, const CORBA::Any &value)
Create NameValue typed CORBA::Any.
std::ostream & operator<<(std::ostream &os, const SDOPackage::NameValue &nv)
std::string toString(const SDOPackage::NVList &nv, const char *name)
Get NVList of specifid name as string.
void append(SDOPackage::NVList &dest, const SDOPackage::NVList &src)
Append an element to NVList.
void copyFromProperties(SDOPackage::NVList &nv, const coil::Properties &prop)
Copy the properties to NVList.
bool appendStringValue(SDOPackage::NVList &nv, const char *name, const char *value)
Append the specified string to element of NVList.
SDOPackage::NameValue newNV(const char *name, Value value)
Create NameValue.
Definition NVUtil.h:80
SDOPackage::NameValue newNVBool(const char *name, CORBA::Boolean value)
Create NameValue typed CORBA::Boolean.
bool isStringValue(const SDOPackage::NVList &nv, const char *name, const char *value)
Check whether the value of specified name matches the specified string.
const CORBA::Any & find(const SDOPackage::NVList &nv, const char *name)
Return the value specified by name from NVList.
SDOPackage::NameValue newNVChar(const char *name, CORBA::Char value)
Create NameValue typed CORBA::Char.