NVUtil.h
Go to the documentation of this file.
00001 // -*- C++ -*-
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    * @if jp
00089    *
00090    * @brief value が CORBA::string の NameValue を生成する
00091    *
00092    * このオペレーションはf value が CORBA::string の NameValueを作成する。
00093    *
00094    * @param name NameValue の name
00095    * @param value NameValue の value
00096    *
00097    * @return NameValue
00098    *
00099    * @else
00100    *
00101    * @brief Create NameValue typed CORBA::string
00102    *
00103    * This operation creates NameValue typed CORBA::string.
00104    *
00105    * @param name Name of NameValue
00106    * @param value The value of NameValue
00107    *
00108    * @return NameValue
00109    *
00110    * @endif
00111    */
00112   /*
00113     template <>
00114     SDOPackage::NameValue newNV(const char* name, const char* value)
00115     {
00116     SDOPackage::NameValue nv;
00117     nv.name = CORBA::string_dup(name);
00118     nv.value <<= value;
00119     return nv;
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 #ifndef ORB_IS_RTORB
00256   void copyFromProperties(SDOPackage::NVList& nv, const coil::Properties& prop);
00257 #else // ORB_IS_RTORB
00258   void copyFromProperties(SDOPackage_NVList& nv, const coil::Properties& prop);
00259 #endif // ORB_IS_RTORB
00260   
00282   void copyToProperties(coil::Properties& prop, const SDOPackage::NVList& nv);
00283   
00307   coil::Properties toProperties(const SDOPackage::NVList& nv);
00308   
00336   const CORBA::Any& find(const SDOPackage::NVList& nv, const char* name);
00337   
00365   const CORBA::Long find_index(const SDOPackage::NVList& nv, const char* name);
00366   
00394   bool isString(const SDOPackage::NVList& nv, const char* name);
00395   
00427   bool isStringValue(const SDOPackage::NVList& nv, const char* name,
00428                      const char* value);
00429   
00459   std::string toString(const SDOPackage::NVList& nv, const char* name);
00460   
00503 #ifndef ORB_IS_RTORB
00504   bool appendStringValue(SDOPackage::NVList& nv, const char* name,
00505                          const char* value);
00506 #else // ORB_IS_RTORB
00507   bool appendStringValue(SDOPackage_NVList& nv, const char* name,
00508                          const char* value);
00509 #endif // ORB_IS_RTORB
00510   
00534   void append(SDOPackage::NVList& dest, const SDOPackage::NVList& src);
00535   
00559   std::ostream& dump(std::ostream& out, const SDOPackage::NVList& nv);
00560 
00575   void dump(const SDOPackage::NVList& nv);
00576 
00590   std::string toString(const SDOPackage::NVList& nv);
00591   
00592 
00593 };
00594 #endif // NVUTIL_NVUTIL_H


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Aug 27 2015 14:16:38