[openrtm-commit:00031] r2082 - trunk/OpenRTM-aist/src/lib/rtm

openrtm @ openrtm.org openrtm @ openrtm.org
2011年 5月 4日 (水) 08:12:46 JST


Author: n-ando
Date: 2011-05-04 08:12:44 +0900 (Wed, 04 May 2011)
New Revision: 2082

Modified:
   trunk/OpenRTM-aist/src/lib/rtm/InPort.h
   trunk/OpenRTM-aist/src/lib/rtm/OutPort.h
   trunk/OpenRTM-aist/src/lib/rtm/Typename.h
Log:
toRepositoryId function has been rewritten for older (3.3) gcc.
Now toRepositoryIdOfStruct/toRepositoryIdOfObject are also available.


Modified: trunk/OpenRTM-aist/src/lib/rtm/InPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPort.h	2011-05-02 20:33:03 UTC (rev 2081)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPort.h	2011-05-03 23:12:44 UTC (rev 2082)
@@ -232,7 +232,11 @@
 	   int bufsize=64, 
 	   bool read_block = false, bool write_block = false,
 	   int read_timeout = 0, int write_timeout = 0)
-      :	InPortBase(name, toTypename<DataType>()),
+#if defined(__GNUC__) && (__GNUC__ <= 3 && __GNUC_MINOR__ <= 3) 
+      :	InPortBase(name, ::CORBA_Util::toRepositoryIdOfStruct<DataType>()),
+#else
+      :	InPortBase(name, ::CORBA_Util::toRepositoryId<DataType>()),
+#endif
         m_name(name), m_value(value),
 	m_OnRead(NULL),  m_OnReadConvert(NULL)
     {

Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPort.h	2011-05-02 20:33:03 UTC (rev 2081)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPort.h	2011-05-03 23:12:44 UTC (rev 2082)
@@ -244,8 +244,12 @@
      * @endif
      */
     OutPort(const char* name, DataType& value)
-      : OutPortBase(name, toTypename<DataType>()), m_value(value),
-        m_onWrite(0), m_onWriteConvert(0)
+#if defined(__GNUC__) && (__GNUC__ <= 3 && __GNUC_MINOR__ <= 3) 
+      : OutPortBase(name, ::CORBA_Util::toRepositoryIdOfStruct<DataType>()),
+#else
+      : OutPortBase(name, ::CORBA_Util::toRepositoryId<DataType>()),
+#endif
+        m_value(value), m_onWrite(0), m_onWriteConvert(0)
     {
     }
     

Modified: trunk/OpenRTM-aist/src/lib/rtm/Typename.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Typename.h	2011-05-02 20:33:03 UTC (rev 2081)
+++ trunk/OpenRTM-aist/src/lib/rtm/Typename.h	2011-05-03 23:12:44 UTC (rev 2082)
@@ -179,6 +179,18 @@
     return typecode<is_corba_object<T>::value, T>::name();
   }
   
+  template <class T>
+  const char* toTypenameOfStruct()
+  {
+    return typecode<false, T>::name();
+  }
+  
+  template <class T>
+  const char* toTypenameOfObject()
+  {
+    return typecode<true, T>::name();
+  }
+  
   /*!
    * @if jp
    * @brief CORBA型のリポジトリIDを文字列で取得する
@@ -221,6 +233,18 @@
   {
     return typecode<is_corba_object<T>::value, T>::id();
   }
+
+  template <class T>
+  const char* toRepositoryIdOfStruct()
+  {
+    return typecode<false, T>::id();
+  }
+
+  template <class T>
+  const char* toRepositoryIdOfObject()
+  {
+    return typecode<true, T>::id();
+  }
   
 }; // namespace CORBA_Util
 



openrtm-commit メーリングリストの案内