[openrtm-commit:02584] r2985 - trunk/OpenRTM-aist/src/lib/rtm

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 4月 19日 (水) 04:11:22 JST


Author: n-ando
Date: 2017-04-19 04:11:22 +0900 (Wed, 19 Apr 2017)
New Revision: 2985

Added:
   trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.cpp
   trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.h
Modified:
   trunk/OpenRTM-aist/src/lib/rtm/DefaultConfiguration.h
   trunk/OpenRTM-aist/src/lib/rtm/Factory.cpp
   trunk/OpenRTM-aist/src/lib/rtm/Factory.h
   trunk/OpenRTM-aist/src/lib/rtm/FactoryInit.cpp
   trunk/OpenRTM-aist/src/lib/rtm/Makefile.am
   trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.cpp
   trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.h
Log:
[incompat,newfunc] To extend the RTC numbering policy, base class has been introduced. refs #3273

Modified: trunk/OpenRTM-aist/src/lib/rtm/DefaultConfiguration.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/DefaultConfiguration.h	2017-04-17 03:38:21 UTC (rev 2984)
+++ trunk/OpenRTM-aist/src/lib/rtm/DefaultConfiguration.h	2017-04-18 19:11:22 UTC (rev 2985)
@@ -84,6 +84,7 @@
     "manager.shutdown_auto",                 "YES",
     "manager.auto_shutdown_duration",        "10.0",
     "manager.name",                          "manager",
+    "manager.components.naming_policy",      "process_unique",
     "manager.command",                       "rtcd",
     "manager.supported_languages",           "C++, Python, Java",
     "manager.modules.C++.manager_cmd",       "rtcd",

Modified: trunk/OpenRTM-aist/src/lib/rtm/Factory.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Factory.cpp	2017-04-17 03:38:21 UTC (rev 2984)
+++ trunk/OpenRTM-aist/src/lib/rtm/Factory.cpp	2017-04-18 19:11:22 UTC (rev 2985)
@@ -79,7 +79,7 @@
   FactoryCXX::FactoryCXX(const coil::Properties& profile,
 			 RtcNewFunc new_func,
 			 RtcDeleteFunc delete_func,
-			 NumberingPolicy* policy)
+                         RTM::NumberingPolicyBase* policy)
     : FactoryBase(profile),
       m_New(new_func),
       m_Delete(delete_func),

Modified: trunk/OpenRTM-aist/src/lib/rtm/Factory.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Factory.h	2017-04-17 03:38:21 UTC (rev 2984)
+++ trunk/OpenRTM-aist/src/lib/rtm/Factory.h	2017-04-18 19:11:22 UTC (rev 2985)
@@ -21,7 +21,7 @@
 #define RTC_FACTORY_H
 
 #include <coil/Properties.h>
-//#include <rtm/RTObject.h>
+#include <rtm/NumberingPolicyBase.h>
 #include <rtm/NumberingPolicy.h>
 
 
@@ -321,9 +321,9 @@
      * @endif
      */
     FactoryCXX(const coil::Properties& profile,
-	       RtcNewFunc new_func,
-	       RtcDeleteFunc delete_func,
-	       NumberingPolicy* policy = new DefaultNumberingPolicy());
+               RtcNewFunc new_func,
+               RtcDeleteFunc delete_func,
+               RTM::NumberingPolicyBase* policy = new RTM::ProcessUniquePolicy());
     
     virtual ~FactoryCXX()
     {
@@ -402,7 +402,7 @@
      * @brief The naming policy on creating the components
      * @endif
      */
-    NumberingPolicy* m_policy;
+    RTM::NumberingPolicyBase* m_policy;
   };
 };
 #endif // RTC_FACTORY_H

Modified: trunk/OpenRTM-aist/src/lib/rtm/FactoryInit.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/FactoryInit.cpp	2017-04-17 03:38:21 UTC (rev 2984)
+++ trunk/OpenRTM-aist/src/lib/rtm/FactoryInit.cpp	2017-04-18 19:11:22 UTC (rev 2985)
@@ -38,6 +38,10 @@
 #include <rtm/InPortDirectProvider.h>
 #include <rtm/InPortDirectConsumer.h>
 
+// RTC name numbering policy
+#include <rtm/NumberingPolicy.h>
+#include <NodeUniquePolicy.h>
+
 void FactoryInit()
 {
     // Logstream
@@ -61,4 +65,9 @@
     OutPortCorbaCdrProviderInit();
     InPortDirectProviderInit();
     InPortDirectConsumerInit();
+
+    // Naming Policy
+    ProcessUniquePolicyInit();
+    //    NodeUniquePolicyInit();
+    //    NamingServiceUniquePolicyInit();
 }

Modified: trunk/OpenRTM-aist/src/lib/rtm/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Makefile.am	2017-04-17 03:38:21 UTC (rev 2984)
+++ trunk/OpenRTM-aist/src/lib/rtm/Makefile.am	2017-04-18 19:11:22 UTC (rev 2985)
@@ -156,6 +156,7 @@
 	ExecutionContextBase.h 	 \
 	InPort.h 		 \
 	InPortConsumer.h 	 \
+	NumberingPolicyBase.h \
 	ObjectManager.h 	 \
 	OutPort.h 		 \
 	OutPortConsumer.h 	 \

Modified: trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.cpp	2017-04-17 03:38:21 UTC (rev 2984)
+++ trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.cpp	2017-04-18 19:11:22 UTC (rev 2985)
@@ -20,70 +20,92 @@
 #include <rtm/NumberingPolicy.h>
 #include <coil/stringutil.h>
 
-//============================================================
-// DefaultNumberingPolicy
-//============================================================
-/*!
- * @if jp
- * @brief オブジェクト生成時の名称作成
- * @else
- * @brief Create the name when creating objects
- * @endif
- */
-std::string DefaultNumberingPolicy::onCreate(void* obj)
+namespace RTM
 {
-  std::vector<void*>::size_type pos;
+  //============================================================
+  // DefaultNumberingPolicy
+  //============================================================
+  /*!
+   * @if jp
+   * @brief オブジェクト生成時の名称作成
+   * @else
+   * @brief Create the name when creating objects
+   * @endif
+   */
+  std::string ProcessUniquePolicy::onCreate(void* obj)
+  {
+    std::vector<void*>::size_type pos;
+    
+    ++m_num;
+    
+    try
+      {
+        pos = find(NULL);
+        m_objects[pos] = obj;
+        return coil::otos(pos);
+      }
+    catch (ObjectNotFound& e)
+      {
+        (void)(e);
+        m_objects.push_back(obj);
+        return coil::otos((int)(m_objects.size() - 1));
+      }
+  }
   
-  ++m_num;
+  /*!
+   * @if jp
+   * @brief オブジェクト削除時の名称解放
+   * @else
+   * @brief Delete the name when deleting objects
+   * @endif
+   */
+  void ProcessUniquePolicy::onDelete(void* obj)
+  {
+    std::vector<void*>::size_type pos;
+    pos = find(obj);
+    if (pos < m_objects.size())
+      {
+        m_objects[pos] = NULL;
+      }
+    --m_num;
+  }
   
-  try
-    {
-      pos = find(NULL);
-      m_objects[pos] = obj;
-      return coil::otos(pos);
-    }
-  catch (ObjectNotFound& e)
-    {
-      (void)(e);
-      m_objects.push_back(obj);
-      return coil::otos((int)(m_objects.size() - 1));
-    }
-}
+  /*!
+   * @if jp
+   * @brief オブジェクトの検索
+   * @else
+   * @brief Find the object
+   * @endif
+   */
+  long int ProcessUniquePolicy::find(void* obj)
+  {
+    std::vector<void*>::size_type len(m_objects.size());
+    std::vector<void*>::size_type i(0);
+    for (i = 0; i < len; ++i)
+      {
+        if (m_objects[i] == obj) return i;
+      }
+    throw ObjectNotFound();
+    return i;
+  }
+}; //namespace RTM  
 
-/*!
- * @if jp
- * @brief オブジェクト削除時の名称解放
- * @else
- * @brief Delete the name when deleting objects
- * @endif
- */
-void DefaultNumberingPolicy::onDelete(void* obj)
+extern "C"
 {
-  std::vector<void*>::size_type pos;
-  pos = find(obj);
-  if (pos < m_objects.size())
-    {
-      m_objects[pos] = NULL;
-    }
-  --m_num;
-}
+  void ProcessUniquePolicyInit()
+  {
+    ::RTM::NumberingPolicyFactory::
+      instance().addFactory("default",
+                            ::coil::Creator< ::RTM::NumberingPolicyBase,
+                                             ::RTM::ProcessUniquePolicy>,
+                            ::coil::Destructor< ::RTM::NumberingPolicyBase,
+                                                ::RTM::ProcessUniquePolicy>);
+    ::RTM::NumberingPolicyFactory::
+      instance().addFactory("process_unique",
+                            ::coil::Creator< ::RTM::NumberingPolicyBase,
+                                             ::RTM::ProcessUniquePolicy>,
+                            ::coil::Destructor< ::RTM::NumberingPolicyBase,
+                                                ::RTM::ProcessUniquePolicy>);
+  }
+};
 
-/*!
- * @if jp
- * @brief オブジェクトの検索
- * @else
- * @brief Find the object
- * @endif
- */
-long int DefaultNumberingPolicy::find(void* obj)
-{
-  std::vector<void*>::size_type len(m_objects.size());
-  std::vector<void*>::size_type i(0);
-  for (i = 0; i < len; ++i)
-    {
-      if (m_objects[i] == obj) return i;
-    }
-  throw ObjectNotFound();
-  return i;
-}
-

Modified: trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.h	2017-04-17 03:38:21 UTC (rev 2984)
+++ trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicy.h	2017-04-18 19:11:22 UTC (rev 2985)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 /*!
- * @file NumberingPolicy.h
+ * @file ProcessUniquePolicy.h
  * @brief Object numbering policy class
  * @date $Date: 2007-12-31 03:08:04 $
  * @author Noriaki Ando <n-ando at aist.go.jp>
@@ -22,244 +22,154 @@
 
 #include <string>
 #include <vector>
+#include <rtm/RTC.h>
+#include <rtm/NumberingPolicyBase.h>
 
-/*!
- * @if jp
- *
- * @class NumberingPolicy
- * @brief オブジェクト生成時ネーミング・ポリシー(命名規則)管理用抽象クラス
- *
- * オブジェクトを生成する際のネーミング・ポリシー(命名規則)を管理するための
- * 抽象インターフェースクラス。
- * 具象クラスは、以下の純粋仮想関数の実装を提供しなければならない。
- * - onCreate() : オブジェクト生成時の名称作成
- * - onDelete() : オブジェクト削除時の名称解放
- *
- * @since 0.4.0
- *
- * @else
- * @class NumberingPolicy
- * @brief Abstruct class for naming policy management when creating objects
- *
- * This is the abstract interface class to manage the naming policy when
- * creating objects.
- * Concrete classes must implement the following pure virtual functions.
- * - onCreate() : Create the name when creating objects.
- * - onDelete() : Delete the name when deleting objects.
- *
- * @since 0.4.0
- *
- * @endif
- */
-class NumberingPolicy
+namespace RTM
 {
-public:
   /*!
    * @if jp
-   * @brief オブジェクト未発見例外処理用構造体
-   * @else
-   * @brief The structures for exception handling when object was not
-   *        found.
-   * @endif
-   */
-  struct ObjectNotFound {};
-  
-  /*!
-   * @if jp
    *
-   * @brief 仮想デストラクタ
-   * 
-   * @else
+   * @class DefaultNumberingPolicy
+   * @brief オブジェクト生成時ネーミング・ポリシー(命名規則)管理用クラス
    *
-   * @brief Virtual destractor
+   * オブジェクトを生成する際のネーミング・ポリシー(命名規則)を管理するための
+   * クラス。
    *
-   * @endif
-   */
-  virtual ~NumberingPolicy(void){};
-  
-  /*!
-   * @if jp
+   * @since 0.4.0
    *
-   * @brief オブジェクト生成時の名称作成
-   *
-   * オブジェクト生成時の名称を生成するための純粋仮想関数
-   * 
-   * @param obj 名称生成対象オブジェクト
-   *
-   * @return 生成したオブジェクト名称
-   *
    * @else
    *
-   * @brief Create the name when creating objects
+   * @class DefaultNumberingPolicy
+   * @brief Class for naming policy management when creating objects
    *
-   * Pure virtual function to create the name when creating objects.
-   * 
-   * @param obj The target object for the creation
+   * This is a class to manage the naming policy when creating objects.
    *
-   * @return Name of the created object
+   * @since 0.4.0
    *
    * @endif
    */
-  virtual std::string onCreate(void* obj) = 0;
-  
-  /*!
-   * @if jp
-   *
-   * @brief オブジェクト削除時の名称解放
-   *
-   * オブジェクト削除時に名称を解放するための純粋仮想関数
-   * 
-   * @param obj 名称解放対象オブジェクト
-   *
-   * @else
-   *
-   * @brief Delete the name when deleting objects
-   *
-   * Pure virtual function to delete the name when deleting object.
-   * 
-   * @param obj The target object of the delete
-   *
-   * @endif
-   */
-  virtual void onDelete(void* obj) = 0;
-};
+  class ProcessUniquePolicy
+    : public NumberingPolicyBase
+  {
+  public:
+    /*!
+     * @if jp
+     *
+     * @brief コンストラクタ
+     *
+     * コンストラクタ
+     *
+     * @else
+     *
+     * @brief Constructor
+     *
+     * Constructor
+     *
+     * @endif
+     */
+    ProcessUniquePolicy() : m_num(0) {};
+    
+    /*!
+     * @if jp
+     *
+     * @brief デストラクタ
+     * 
+     * @else
+     *
+     * @brief Destractor
+     *
+     * @endif
+     */
+    virtual ~ProcessUniquePolicy(void){};
+    
+    /*!
+     * @if jp
+     *
+     * @brief オブジェクト生成時の名称作成
+     *
+     * オブジェクト生成時の名称を生成する。
+     * 生成済みインスタンスの数に応じた名称を生成する。
+     * 
+     * @param obj 名称生成対象オブジェクト
+     *
+     * @return 生成したオブジェクト名称
+     *
+     * @else
+     *
+     * @brief Create the name when creating object
+     *
+     * Create the name when creating object.
+     * Create the name corresponding to the number of generated instances.
+     * 
+     * @param obj The target object for the name creation
+     *
+     * @return Names of the created object
+     *
+     * @endif
+     */
+    virtual std::string onCreate(void* obj);
+    
+    /*!
+     * @if jp
+     *
+     * @brief オブジェクト削除時の名称解放
+     *
+     * オブジェクト削除時に名称を解放する。
+     * オブジェクト削除時に生成済みインスタンス数を減算する。
+     * 
+     * @param obj 名称解放対象オブジェクト
+     *
+     * @else
+     *
+     * @brief Delete the name when deleting object
+     *
+     * Delete the name when deleting object.
+     * Substract the generated number of instances when deleting the object.
+     * 
+     * @param obj The target object for the name delete
+     *
+     * @endif
+     */
+    virtual void onDelete(void* obj);
+    
+  protected:
+    /*!
+     * @if jp
+     *
+     * @brief オブジェクトの検索
+     *
+     * オブジェクトリストから指定されたオブジェクトを検索し、
+     * 該当するオブジェクトが格納されている場合にはインデックスを返す。
+     * 
+     * @param obj 検索対象オブジェクト
+     *
+     * @return オブジェクト格納インデックス
+     *
+     * @else
+     *
+     * @brief Find the object
+     *
+     * Find the specified object in the object list and return its index
+     * when it is stored.
+     * 
+     * @param obj The target object for the find
+     *
+     * @return Object index for storage
+     *
+     * @endif
+     */
+    long int find(void* obj);
+    
+  private:
+    int m_num;
+    std::vector<void*> m_objects;
+  };
+}; // namespace RTM
 
-/*!
- * @if jp
- *
- * @class DefaultNumberingPolicy
- * @brief オブジェクト生成時ネーミング・ポリシー(命名規則)管理用クラス
- *
- * オブジェクトを生成する際のネーミング・ポリシー(命名規則)を管理するための
- * クラス。
- *
- * @since 0.4.0
- *
- * @else
- *
- * @class DefaultNumberingPolicy
- * @brief Class for naming policy management when creating objects
- *
- * This is a class to manage the naming policy when creating objects.
- *
- * @since 0.4.0
- *
- * @endif
- */
-class DefaultNumberingPolicy
-  : public NumberingPolicy 
+extern "C"
 {
-public:
-  /*!
-   * @if jp
-   *
-   * @brief コンストラクタ
-   * 
-   * コンストラクタ
-   * 
-   * @else
-   *
-   * @brief Constructor
-   * 
-   * Constructor
-   * 
-   * @endif
-   */
-  DefaultNumberingPolicy() : m_num(0) {};
-  
-  /*!
-   * @if jp
-   *
-   * @brief デストラクタ
-   * 
-   * @else
-   *
-   * @brief Destractor
-   *
-   * @endif
-   */
-  virtual ~DefaultNumberingPolicy(void){};
-  
-  /*!
-   * @if jp
-   *
-   * @brief オブジェクト生成時の名称作成
-   *
-   * オブジェクト生成時の名称を生成する。
-   * 生成済みインスタンスの数に応じた名称を生成する。
-   * 
-   * @param obj 名称生成対象オブジェクト
-   *
-   * @return 生成したオブジェクト名称
-   *
-   * @else
-   *
-   * @brief Create the name when creating object
-   *
-   * Create the name when creating object.
-   * Create the name corresponding to the number of generated instances.
-   * 
-   * @param obj The target object for the name creation
-   *
-   * @return Names of the created object
-   *
-   * @endif
-   */
-  virtual std::string onCreate(void* obj);
-  
-  /*!
-   * @if jp
-   *
-   * @brief オブジェクト削除時の名称解放
-   *
-   * オブジェクト削除時に名称を解放する。
-   * オブジェクト削除時に生成済みインスタンス数を減算する。
-   * 
-   * @param obj 名称解放対象オブジェクト
-   *
-   * @else
-   *
-   * @brief Delete the name when deleting object
-   *
-   * Delete the name when deleting object.
-   * Substract the generated number of instances when deleting the object.
-   * 
-   * @param obj The target object for the name delete
-   *
-   * @endif
-   */
-  virtual void onDelete(void* obj);
-  
-protected:
-  /*!
-   * @if jp
-   *
-   * @brief オブジェクトの検索
-   *
-   * オブジェクトリストから指定されたオブジェクトを検索し、
-   * 該当するオブジェクトが格納されている場合にはインデックスを返す。
-   * 
-   * @param obj 検索対象オブジェクト
-   *
-   * @return オブジェクト格納インデックス
-   *
-   * @else
-   *
-   * @brief Find the object
-   *
-   * Find the specified object in the object list and return its index
-   * when it is stored.
-   * 
-   * @param obj The target object for the find
-   *
-   * @return Object index for storage
-   *
-   * @endif
-   */
-  long int find(void* obj);
-  
-private:
-  int m_num;
-  std::vector<void*> m_objects;
+  void DLL_EXPORT ProcessUniquePolicyInit();
 };
+
 #endif // RTC_NUMBERINGPOLICY_H

Added: trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.cpp	                        (rev 0)
+++ trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.cpp	2017-04-18 19:11:22 UTC (rev 2985)
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+/*!
+ * @file NumberingPolicy.cpp
+ * @brief Object numbering policy class
+ * @date $Date: 2007-12-31 03:08:04 $
+ * @author Noriaki Ando <n-ando at aist.go.jp>
+ *
+ * Copyright (C) 2006-2008
+ *     Noriaki Ando
+ *     Task-intelligence Research Group,
+ *     Intelligent Systems Research Institute,
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ * $Id: NumberingPolicy.cpp 1370 2009-05-22 08:17:09Z n-ando $
+ *
+ */
+
+#include <rtm/NumberingPolicy.h>
+#include <coil/stringutil.h>
+
+//============================================================
+// DefaultNumberingPolicy
+//============================================================
+/*!
+ * @if jp
+ * @brief オブジェクト生成時の名称作成
+ * @else
+ * @brief Create the name when creating objects
+ * @endif
+ */
+std::string DefaultNumberingPolicy::onCreate(void* obj)
+{
+  std::vector<void*>::size_type pos;
+  
+  ++m_num;
+  
+  try
+    {
+      pos = find(NULL);
+      m_objects[pos] = obj;
+      return coil::otos(pos);
+    }
+  catch (ObjectNotFound& e)
+    {
+      (void)(e);
+      m_objects.push_back(obj);
+      return coil::otos((int)(m_objects.size() - 1));
+    }
+}
+
+/*!
+ * @if jp
+ * @brief オブジェクト削除時の名称解放
+ * @else
+ * @brief Delete the name when deleting objects
+ * @endif
+ */
+void DefaultNumberingPolicy::onDelete(void* obj)
+{
+  std::vector<void*>::size_type pos;
+  pos = find(obj);
+  if (pos < m_objects.size())
+    {
+      m_objects[pos] = NULL;
+    }
+  --m_num;
+}
+
+/*!
+ * @if jp
+ * @brief オブジェクトの検索
+ * @else
+ * @brief Find the object
+ * @endif
+ */
+long int DefaultNumberingPolicy::find(void* obj)
+{
+  std::vector<void*>::size_type len(m_objects.size());
+  std::vector<void*>::size_type i(0);
+  for (i = 0; i < len; ++i)
+    {
+      if (m_objects[i] == obj) return i;
+    }
+  throw ObjectNotFound();
+  return i;
+}
+

Added: trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.h	                        (rev 0)
+++ trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.h	2017-04-18 19:11:22 UTC (rev 2985)
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+/*!
+ * @file NumberingPolicyBase.h
+ * @brief Object numbering policy base class
+ * @date $Date$
+ * @author Noriaki Ando <n-ando at aist.go.jp>
+ *
+ * Copyright (C) 2017
+ *     Noriaki Ando
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ * $Id$
+ *
+ */
+
+#ifndef RTC_NUMBERINGPOLICYBASE_H
+#define RTC_NUMBERINGPOLICYBASE_H
+
+#include <string>
+#include <vector>
+#include <coil/Factory.h>
+
+namespace RTM
+{
+  /*!
+   * @if jp
+   *
+   * @class NumberingPolicyBase
+   * @brief オブジェクト生成時ネーミング・ポリシー(命名規則)管理用抽象クラス
+   *
+   * オブジェクトを生成する際のネーミング・ポリシー(命名規則)を管理するための
+   * 抽象インターフェースクラス。
+   * 具象クラスは、以下の純粋仮想関数の実装を提供しなければならない。
+   * - onCreate() : オブジェクト生成時の名称作成
+   * - onDelete() : オブジェクト削除時の名称解放
+   *
+   * @since 1.2
+   *
+   * @else
+   * @class NumberingPolicy
+   * @brief Abstruct class for naming policy management when creating objects
+   *
+   * This is the abstract interface class to manage the naming policy when
+   * creating objects.
+   * Concrete classes must implement the following pure virtual functions.
+   * - onCreate() : Create the name when creating objects.
+   * - onDelete() : Delete the name when deleting objects.
+   *
+   * @since 0.4.0
+   *
+   * @endif
+   */
+  class NumberingPolicyBase
+  {
+  public:
+    /*!
+     * @if jp
+     * @brief オブジェクト未発見例外処理用構造体
+     * @else
+     * @brief The structures for exception handling when object was not
+     *        found.
+     * @endif
+     */
+    struct ObjectNotFound {};
+    
+    /*!
+     * @if jp
+     *
+     * @brief 仮想デストラクタ
+     * 
+     * @else
+     *
+     * @brief Virtual destractor
+     *
+     * @endif
+     */
+    virtual ~NumberingPolicyBase(void) {};
+    
+    /*!
+     * @if jp
+     *
+     * @brief オブジェクト生成時の名称作成
+     *
+     * オブジェクト生成時の名称を生成するための純粋仮想関数
+     * 
+     * @param obj 名称生成対象オブジェクト
+     *
+     * @return 生成したオブジェクト名称
+     *
+     * @else
+     *
+     * @brief Create the name when creating objects
+     *
+     * Pure virtual function to create the name when creating objects.
+     * 
+     * @param obj The target object for the creation
+     *
+     * @return Name of the created object
+     *
+     * @endif
+     */
+    virtual std::string onCreate(void* obj) = 0;
+    
+    /*!
+     * @if jp
+     *
+     * @brief オブジェクト削除時の名称解放
+     *
+     * オブジェクト削除時に名称を解放するための純粋仮想関数
+     * 
+     * @param obj 名称解放対象オブジェクト
+     *
+     * @else
+     *
+     * @brief Delete the name when deleting objects
+     *
+     * Pure virtual function to delete the name when deleting object.
+     * 
+     * @param obj The target object of the delete
+     *
+     * @endif
+     */
+    virtual void onDelete(void* obj) = 0;
+  };
+  
+  typedef coil::GlobalFactory<NumberingPolicyBase> NumberingPolicyFactory;
+  
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
+  EXTERN template class DLL_PLUGIN coil::GlobalFactory<NumberingPolicyBase>;
+#endif
+  
+};
+#endif // RTC_NUMBERINGPOLICYBASE_H


Property changes on: trunk/OpenRTM-aist/src/lib/rtm/NumberingPolicyBase.h
___________________________________________________________________
Added: svn:executable
   + *



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