[openrtm-commit:02981] r3115 - in trunk/OpenRTM-aist: src/ext/sdo/fsm4rtc_observer src/ext/sdo/fsm4rtc_observer/test src/lib/hrtm src/lib/rtm win32/OpenRTM-aist/examples/Fsm win32/OpenRTM-aist/hrtm win32/OpenRTM-aist/hrtm/idls

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 12月 11日 (月) 06:18:08 JST


Author: n-ando
Date: 2017-12-11 06:18:08 +0900 (Mon, 11 Dec 2017)
New Revision: 3115

Added:
   trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/idl/
   trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/observer.py
   trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/rtc.conf
   trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.cpp
   trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.h
Modified:
   trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.cpp
   trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.h
   trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/test.sh
   trunk/OpenRTM-aist/src/lib/hrtm/component_manager.cpp
   trunk/OpenRTM-aist/src/lib/hrtm/data_flow_component.cpp
   trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp
   trunk/OpenRTM-aist/src/lib/rtm/Makefile.am
   trunk/OpenRTM-aist/src/lib/rtm/NVUtil.cpp
   trunk/OpenRTM-aist/src/lib/rtm/NVUtil.h
   trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp
   trunk/OpenRTM-aist/src/lib/rtm/RTObject.h
   trunk/OpenRTM-aist/win32/OpenRTM-aist/examples/Fsm/Makefile.am
   trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/Makefile.am
   trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/idls/Makefile.am
Log:
merged changes from branches/FSM4RTC/OpenRTM-aist r2773-2806, no confliction:
[FSM4RTC,compat,->RELENG_2_0] Some Makefile.am bugs are fixed.
[FSM4RTC,HRTM,bugfix,->RELENG_2_0] Manager/ComponentManager initialization bug has been fixed. refs #3653
[FSM4RTC,->RELENG_2_0] FSM action listener added. refs #3680
[FSM4RTC,incompat,->RELENG_2_0] renameed FsmStructureAction->FsmStructure, FsmProfileListener added. refs #3680
[FSM4RTC,incompat,->RELENG_2_0] FSM listeners add/remove operations are added to RTObject. refs #3681
[FSM4RTC,ext,example,->RELENG_2_0] Now component observer is connected to the FSM state change operation. refs #3591
[FSM4RTC,HRTM,,->RELENG_2_0] updateFsmStatus now calls RTObject::onFsmStateChanged(). refs #3681
[compat,formatting,->RELENG_1_2,->RELENG_2_0] Braces added.
[incompat,->RELENG_1_2,->RELENG_2_0] std::ostream operations have been added to NVUtil.


Modified: trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.cpp	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.cpp	2017-12-10 21:18:08 UTC (rev 3115)
@@ -763,6 +763,10 @@
    */
   void ComponentObserverConsumer::setFSMStructureListeners()
   {
+    m_fsmaction.fsmActionListener = 
+      m_rtobj->addPreFsmActionListener(PRE_ON_STATE_CHANGE,
+                                       m_fsmaction,
+                                       &FSMAction::updateFsmStatus);
   }
 
   /*!

Modified: trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.h	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/ComponentObserverConsumer.h	2017-12-10 21:18:08 UTC (rev 3115)
@@ -26,6 +26,7 @@
 #include <rtm/SdoServiceConsumerBase.h>
 #include <rtm/CorbaConsumer.h>
 #include <rtm/ComponentActionListener.h>
+#include <rtm/FsmActionListener.h>
 #include <rtm/idl/SDOPackageStub.h>
 #include "ComponentObserverStub.h"
 
@@ -625,8 +626,14 @@
       FSMAction(ComponentObserverConsumer& coc)
         : m_coc(coc) {}
       // Action callback functions here
+      void updateFsmStatus(const char* state)
+      {
+        std::cout << "ComponentObserver::updateFsmStatus(" << state << ")" << std::endl; 
+        m_coc.updateStatus(RTC::FSM_STATUS, state);
+      }
       
       // Listener object's pointer holder
+      PreFsmActionListener* fsmActionListener;
 
     private:
       ComponentObserverConsumer& m_coc;

Copied: trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/observer.py (from rev 2806, branches/FSM4RTC/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/observer.py)
===================================================================
--- trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/observer.py	                        (rev 0)
+++ trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/observer.py	2017-12-10 21:18:08 UTC (rev 3115)
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+# -*- Python -*-
+# -*- coding: utf-8 -*-
+
+#import sys
+#sys.path = sys.path
+
+import idl
+import RTC__POA
+import idl.ComponentObserver_idl
+import SDOPackage
+from omniORB import CORBA, PortableServer, any
+import omniORB
+import sys
+import uuid
+
+def dict_to_nvlist(dict):
+    '''Convert a dictionary into a CORBA namevalue list.'''
+    result = []
+    for item in list(dict.keys()):
+        result.append(SDOPackage.NameValue(item, omniORB.any.to_any(dict[item])))
+    return result
+
+class RTCObserver(RTC__POA.ComponentObserver):
+    def __init__(self):
+        pass
+        
+    def update_status(self, kind, hint):
+        kind = str(kind)
+        print "kind: " + kind + " hint: " + hint
+
+
+orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
+poa = orb.resolve_initial_references("RootPOA")
+poa._get_the_POAManager().activate()
+
+fd = open("comp.ior", "r")
+ior = fd.readline()
+fd.close()
+
+print ior
+
+obj = orb.string_to_object(ior)
+sdo = obj._narrow(SDOPackage.SDO)
+conf = sdo.get_configuration()
+
+obs = RTCObserver()
+uuid_val = uuid.uuid4().get_bytes()
+intf_type = obs._this()._NP_RepositoryId
+props = dict_to_nvlist({'heartbeat.enable': 'YES',
+                        'heartbeat.interval': '1.0',
+                        'observed_status': 'ALL'})
+
+sprof = SDOPackage.ServiceProfile(id=uuid_val,
+                                  interface_type=intf_type,
+                                  service=obs._this(),
+                                  properties=props)
+res = conf.add_service_profile(sprof)
+orb.run()
+print res

Copied: trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/rtc.conf (from rev 2806, branches/FSM4RTC/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/rtc.conf)
===================================================================
--- trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/rtc.conf	                        (rev 0)
+++ trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/rtc.conf	2017-12-10 21:18:08 UTC (rev 3115)
@@ -0,0 +1,12 @@
+logger.enable: YES
+logger.log_level: TRACE
+naming.formats: comp.ior
+
+manager.local_service.org.openrtm.local_service.nameservice.file_nameservice.base_path: ./ 
+manager.local_service.org.openrtm.local_service.nameservice.file_nameservice.file_structure: flat 
+manager.local_service.org.openrtm.local_service.nameservice.file_nameservice.context_delimiter: .
+
+manager.local_service.modules: \
+    ../.libs/ComponentObserverConsumer.so(ComponentObserverConsumerInit), \
+    ../../../local_service/nameservice_file/.libs/FileNameservice.so(FileNameserviceInit)
+

Modified: trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/test.sh
===================================================================
--- trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/test.sh	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/ext/sdo/fsm4rtc_observer/test/test.sh	2017-12-10 21:18:08 UTC (rev 3115)
@@ -1,4 +1,5 @@
 #!/bin/sh
 rm *.log
-../../../../../examples/SimpleIO/ConsoleInComp -o "logger.log_level:DEBUG" -o "manager.local_service.modules:../.libs/ComponentObserverConsumer.so(ComponentObserverConsumerInit)"
+../../../../../examples/Fsm/FsmComp -f ./rtc.conf
 
+

Modified: trunk/OpenRTM-aist/src/lib/hrtm/component_manager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/hrtm/component_manager.cpp	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/hrtm/component_manager.cpp	2017-12-10 21:18:08 UTC (rev 3115)
@@ -56,6 +56,7 @@
   }
   ComponentManager& ComponentManager::instance(int argc, char** argv)
   {
+   
     // DCL for singleton
     if (!manager)
       {
@@ -63,6 +64,8 @@
         if (!manager)
           {
             manager = new ComponentManager();
+            RTC::Manager::manager = manager;
+            printf("init ComponentManager: %x\n", manager);
             manager->initManager(argc, argv);
             manager->initLogger();
             manager->initORB();

Modified: trunk/OpenRTM-aist/src/lib/hrtm/data_flow_component.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/hrtm/data_flow_component.cpp	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/hrtm/data_flow_component.cpp	2017-12-10 21:18:08 UTC (rev 3115)
@@ -27,7 +27,6 @@
   }
   RTC::ReturnCode_t DataFlowComponent::initialize(hrtm::ComponentManager* mgr)
   {
-    std::cout << "########## initialize()" << std::endl;
     return RTC::RTC_OK;
   }
 
@@ -34,6 +33,6 @@
   void DataFlowComponent::updateFsmStatus(RTC::StatusKind status_kind,
                                           const char* state)
   {
-    std::cout << "State: " << state << std::endl;
+    onFsmStateChanged(state);
   }
 }; // namespace hrtm

Copied: trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.cpp (from rev 2806, branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/FsmActionListener.cpp)
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.cpp	                        (rev 0)
+++ trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.cpp	2017-12-10 21:18:08 UTC (rev 3115)
@@ -0,0 +1,304 @@
+// -*- C++ -*-
+/*!
+ * @file FsmActionListener.cpp
+ * @brief Component action listener class
+ * @date $Date$
+ * @author Noriaki Ando <n-ando at aist.go.jp>
+ *
+ * Copyright (C) 2011
+ *     Noriaki Ando
+ *     Intelligent Systems Research Institute,
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ * $Id$
+ *
+ */
+
+#include <rtm/FsmActionListener.h>
+
+namespace RTC
+{
+
+  //============================================================
+  /*!
+   * @if jp
+   * @class PostFsmActionListener ¥¯¥é¥¹
+   * @else
+   * @class PostFsmActionListener class
+   * @endif
+   */
+  PostFsmActionListener::~PostFsmActionListener(){}
+
+  /*!
+   * @if jp
+   * @class PreFsmActionListener ¥¯¥é¥¹
+   * @else
+   * @class PreFsmActionListener class
+   * @endif
+   */
+  PreFsmActionListener::~PreFsmActionListener(){}
+
+  /*!
+   * @if jp
+   * @class FsmProfileListener ¥¯¥é¥¹
+   * @else
+   * @class PortActionListener class
+   * @endif
+   */
+  FsmProfileListener::~FsmProfileListener(){}
+
+  /*!
+   * @if jp
+   * @class PortActionListener ¥¯¥é¥¹
+   * @else
+   * @class PortActionListener class
+   * @endif
+   */
+  FsmStructureListener::~FsmStructureListener(){}
+
+
+
+  //============================================================
+  /*!
+   * @if jp
+   * @class PreFsmActionListener ¥Û¥ë¥À¥¯¥é¥¹
+   * @else
+   * @class PreFsmActionListener holder class
+   * @endif
+   */
+  PreFsmActionListenerHolder::PreFsmActionListenerHolder()
+  {
+  }
+
+  PreFsmActionListenerHolder::~PreFsmActionListenerHolder()
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        if (m_listeners[i].second)
+          {
+            delete m_listeners[i].first;
+          }
+      }
+  }
+
+  void PreFsmActionListenerHolder::
+  addListener(PreFsmActionListener* listener,
+              bool autoclean)
+  {
+    Guard guard(m_mutex);
+    m_listeners.push_back(Entry(listener, autoclean));
+  }
+
+  void PreFsmActionListenerHolder::
+  removeListener(PreFsmActionListener* listener)
+  {
+    Guard guard(m_mutex);
+    std::vector<Entry>::iterator it(m_listeners.begin());
+
+    for (; it != m_listeners.end(); ++it)
+      {
+        if ((*it).first == listener)
+          {
+            if ((*it).second)
+              {
+                delete (*it).first;
+              }
+            m_listeners.erase(it);
+            return;
+          }
+      }
+  }
+
+  void PreFsmActionListenerHolder::notify(const char* state)
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        m_listeners[i].first->operator()(state);
+      }
+  }
+
+  //============================================================
+  /*!
+   * @if jp
+   * @class PostFsmActionListener ¥Û¥ë¥À¥¯¥é¥¹
+   * @else
+   * @class PostFsmActionListener holder class
+   * @endif
+   */
+  PostFsmActionListenerHolder::PostFsmActionListenerHolder()
+  {
+  }
+
+  PostFsmActionListenerHolder::~PostFsmActionListenerHolder()
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        if (m_listeners[i].second)
+          {
+            delete m_listeners[i].first;
+          }
+      }
+  }
+
+  void PostFsmActionListenerHolder::
+  addListener(PostFsmActionListener* listener, bool autoclean)
+  {
+    Guard guard(m_mutex);
+    m_listeners.push_back(Entry(listener, autoclean));
+  }
+
+  void PostFsmActionListenerHolder::
+  removeListener(PostFsmActionListener* listener)
+  {
+    Guard guard(m_mutex);
+    std::vector<Entry>::iterator it(m_listeners.begin());
+    for (; it != m_listeners.end(); ++it)
+      {
+        if ((*it).first == listener)
+          {
+            if ((*it).second)
+              {
+                delete (*it).first;
+              }
+            m_listeners.erase(it);
+            return;
+          }
+      }
+  }
+
+  void PostFsmActionListenerHolder::notify(const char* state,
+                                           ReturnCode_t ret)
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        m_listeners[i].first->operator()(state, ret);
+      }
+  }
+
+  /*!
+   * @if jp
+   * @class FsmProfileListener ¥Û¥ë¥À¥¯¥é¥¹
+   * @else
+   * @class FsmProfileListener holder class
+   * @endif
+   */
+  FsmProfileListenerHolder::FsmProfileListenerHolder()
+  {
+  }
+
+  FsmProfileListenerHolder::~FsmProfileListenerHolder()
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        if (m_listeners[i].second)
+          {
+            delete m_listeners[i].first;
+          }
+      }
+  }
+
+  void FsmProfileListenerHolder::addListener(FsmProfileListener* listener,
+                                             bool autoclean)
+  {
+    Guard guard(m_mutex);
+    m_listeners.push_back(Entry(listener, autoclean));
+  }
+
+  void
+  FsmProfileListenerHolder::removeListener(FsmProfileListener* listener)
+  {
+    Guard guard(m_mutex);
+    std::vector<Entry>::iterator it(m_listeners.begin());
+
+    for (; it != m_listeners.end(); ++it)
+      {
+        if ((*it).first == listener)
+          {
+            if ((*it).second)
+              {
+                delete (*it).first;
+              }
+            m_listeners.erase(it);
+            return;
+          }
+      }
+  }
+
+  void FsmProfileListenerHolder::notify(RTC::FsmProfile& profile)
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        m_listeners[i].first->operator()(profile);
+      }
+  }
+
+  /*!
+   * @if jp
+   * @class FsmStructureListener ¥Û¥ë¥À¥¯¥é¥¹
+   * @else
+   * @class FsmStructureListener holder class
+   * @endif
+   */
+  FsmStructureListenerHolder::FsmStructureListenerHolder()
+  {
+  }
+
+  FsmStructureListenerHolder::~FsmStructureListenerHolder()
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        if (m_listeners[i].second)
+          {
+            delete m_listeners[i].first;
+          }
+      }
+  }
+
+  void FsmStructureListenerHolder::addListener(FsmStructureListener* listener,
+                                               bool autoclean)
+  {
+    Guard guard(m_mutex);
+    m_listeners.push_back(Entry(listener, autoclean));
+  }
+
+  void
+  FsmStructureListenerHolder::removeListener(FsmStructureListener* listener)
+  {
+    Guard guard(m_mutex);
+    std::vector<Entry>::iterator it(m_listeners.begin());
+
+    for (; it != m_listeners.end(); ++it)
+      {
+        if ((*it).first == listener)
+          {
+            if ((*it).second)
+              {
+                delete (*it).first;
+              }
+            m_listeners.erase(it);
+            return;
+          }
+      }
+  }
+
+  void FsmStructureListenerHolder::notify(RTC::FsmStructure& structure)
+  {
+    Guard guard(m_mutex);
+    for (int i(0), len(m_listeners.size()); i < len; ++i)
+      {
+        m_listeners[i].first->operator()(structure);
+      }
+  }
+
+};
+
+

Copied: trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.h (from rev 2806, branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/FsmActionListener.h)
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.h	                        (rev 0)
+++ trunk/OpenRTM-aist/src/lib/rtm/FsmActionListener.h	2017-12-10 21:18:08 UTC (rev 3115)
@@ -0,0 +1,1039 @@
+// -*- C++ -*-
+/*!
+ * @file FsmActionListener.h
+ * @brief component action listener class
+ * @date $Date$
+ * @author Noriaki Ando <n-ando at aist.go.jp>
+ *
+ * Copyright (C) 2011
+ *     Noriaki Ando
+ *     Intelligent Systems Research Institute,
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ * $Id$
+ *
+ */
+
+#ifndef RTC_FSMACTIONLISTENER_H
+#define RTC_FSMACTIONLISTENER_H
+
+#include <vector>
+#include <utility>
+#include <coil/Mutex.h>
+#include <coil/Guard.h>
+#include <rtm/RTC.h>
+#include <rtm/idl/RTCSkel.h>
+#include <rtm/ConnectorBase.h>
+
+namespace RTC
+{
+  struct FsmStructure
+  {
+  };
+  /*!
+   * @if jp
+   *
+   * FSM¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Ë´Ø¤¹¤ë¼ï¡¹¤Î¿¶¤ëÉñ¤¤¤ò¥Õ¥Ã¥¯¤¹¤ë¤¿¤á¤Î¥ê¥¹¥ÊÄê
+   * µÁ¡£¥ê¥¹¥Ê¤Ë¤ÏÂ礭¤¯Ê¬¤±¤ë¤È¡¢
+   *
+   * - FSM¤½¤Î¤â¤Î¤ÎÆ°ºî¤ò¥Õ¥Ã¥¯¤¹¤ë¤¿¤á¤Î¥ê¥¹¥Ê
+   * - FSM¤Ë´Ø¤¹¤ë¥á¥¿¥Ç¡¼¥¿Êѹ¹Åù¤ÎÆ°ºî¤ò¥Õ¥Ã¥¯¤¹¤ë¤¿¤á¤Î¥ê¥¹¥Ê
+   *
+   * ¤Î2¼ïÎà¤Ëʬ¤±¤é¤ì¤ë¡£
+   *
+   * - PreFsmActionListener
+   * - PostFsmActionListener
+   * - FsmProfileListner
+   * - FsmStructureListener
+   */
+
+  //============================================================
+  /*!
+   * @if jp
+   * @brief PreFsmActionListener ¤Î¥¿¥¤¥×
+   *
+   * - PRE_ON_INIT:          on_init ľÁ°
+   * - PRE_ON_ENTRY:         on_entry ľÁ°
+   * - PRE_ON_DO:            on_do ľÁ°
+   * - PRE_ON_EXIT:          on_exit ľÁ°
+   * - PRE_ON_STATE_CHANGE:  ¾õÂÖÁ«°ÜľÁ°
+   *
+   * @else
+   * @brief The types of ConnectorDataListener
+   * 
+   * @endif
+   */
+
+  enum PreFsmActionListenerType
+    {
+      PRE_ON_INIT,
+      PRE_ON_ENTRY,
+      PRE_ON_DO,
+      PRE_ON_EXIT,
+      PRE_ON_STATE_CHANGE,
+      PRE_FSM_ACTION_LISTENER_NUM
+    };
+
+  /*!
+   * @if jp
+   * @class PreFsmActionListener ¥¯¥é¥¹
+   * @brief PreFsmActionListener ¥¯¥é¥¹
+   *
+   * - on_init()
+   * - on_entry()
+   * - on_do()
+   * - on_exit()
+   * - on_state_update()
+   *
+   * ³Æ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥æ¡¼¥¶¡¼¥³¡¼¥É¤¬¸Æ¤Ð¤ì¤ëľÁ°¤Î¥¿¥¤¥ß¥ó¥°
+   * ¤Ç¥³¡¼¥ë¤µ¤ì¤ë¥ê¥¹¥Ê¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¡£
+   *
+   * - PRE_ON_INIT:
+   * - PRE_ON_ENTRY:
+   * - PRE_ON_DO:
+   * - PRE_ON_EXIT:
+   * - PRE_ON_STATE_CHANGE:
+   *
+   * @else
+   * @class PreFsmActionListener class
+   * @brief PreFsmActionListener class
+   *
+   * This class is abstract base class for listener classes that
+   * provides callbacks for various events in rtobject.
+   *
+   * @endif
+   */
+  class PreFsmActionListener
+  {
+  public:
+    /*!
+     * @if jp
+     *
+     * @brief PreFsmActionListenerType ¤òʸ»úÎó¤ËÊÑ´¹
+     *
+     * PreFsmActionListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë
+     *
+     * @param type ÊÑ´¹ÂÐ¾Ý PreFsmActionListenerType
+     *
+     * @return ʸ»úÎóÊÑ´¹·ë²Ì
+     *
+     * @else
+     *
+     * @brief Convert PreFsmActionListenerType into the string.
+     *
+     * Convert PreFsmActionListenerType into the string.
+     *
+     * @param type The target PreFsmActionListenerType for transformation
+     *
+     * @return Trnasformation result of string representation
+     *
+     * @endif
+     */
+    static const char* toString(PreFsmActionListenerType type)
+    {
+      static const char* typeString[] =
+        {
+          "PRE_ON_INIT",
+          "PRE_ON_ENTRY",
+          "PRE_ON_DO",
+          "PRE_ON_EXIT",
+          "PRE_ON_STATE_CHANGE",
+          "PRE_FSM_ACTION_LISTENER_NUM"
+        };
+      if (type < PRE_FSM_ACTION_LISTENER_NUM) { return typeString[type]; }
+      return "";
+    }
+
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~PreFsmActionListener();
+
+    /*!
+     * @if jp
+     *
+     * @brief ²¾ÁÛ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * PreFsmActionListener ¤Î¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * @else
+     *
+     * @brief Virtual Callback function
+     *
+     * This is a the Callback function for PreFsmActionListener.
+     *
+     * @endif
+     */
+    virtual void operator()(const char*) = 0;
+  };
+
+
+  //============================================================
+  /*!
+   * @if jp
+   * @brief PostCompoenntActionListener ¤Î¥¿¥¤¥×
+   *
+   * - POST_ON_INIT:
+   * - POST_ON_ENTRY:
+   * - POST_ON_DO:
+   * - POST_ON_EXIT:
+   * - POST_ON_STATE_CHANGE:
+   *
+   * @else
+   * @brief The types of ConnectorDataListener
+   * 
+   * @endif
+   */
+  enum PostFsmActionListenerType
+    {
+      POST_ON_INIT,
+      POST_ON_ENTRY,
+      POST_ON_DO,
+      POST_ON_EXIT,
+      POST_ON_STATE_CHANGE,
+      POST_FSM_ACTION_LISTENER_NUM
+    };
+
+
+  /*!
+   * @if jp
+   * @class PostFsmActionListener ¥¯¥é¥¹
+   * @brief PostFsmActionListener ¥¯¥é¥¹
+   *
+   * OMG RTC»ÅÍͤÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë°Ê²¼¤Î¥³¥ó¥Ý¡¼¥Í¥ó¥È¥¢¥¯¥·¥ç¥ó¥È¤Ë¤Ä¤¤
+   * ¤Æ¡¢
+   *
+   * - on_init()
+   * - on_entry()
+   * - on_do()
+   * - on_exit()
+   * - on_state_change()
+   *
+   * ³Æ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥æ¡¼¥¶¡¼¥³¡¼¥É¤¬¸Æ¤Ð¤ì¤ëľÁ°¤Î¥¿¥¤¥ß¥ó¥°
+   * ¤Ç¥³¡¼¥ë¤µ¤ì¤ë¥ê¥¹¤Ê¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¡£
+   *
+   * - POST_ON_INIT:
+   * - POST_ON_ENTRY:
+   * - POST_ON_DO:
+   * - POST_ON_EXIT:
+   * - POST_ON_STATE_CHANGE:
+   *
+   * @else
+   * @class PostFsmActionListener class
+   * @brief PostFsmActionListener class
+   *
+   * This class is abstract base class for listener classes that
+   * provides callbacks for various events in rtobject.
+   *
+   * @endif
+   */
+  class PostFsmActionListener
+  {
+  public:
+    /*!
+     * @if jp
+     *
+     * @brief PostFsmActionListenerType ¤òʸ»úÎó¤ËÊÑ´¹
+     *
+     * PostFsmActionListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë
+     *
+     * @param type ÊÑ´¹ÂÐ¾Ý PostFsmActionListenerType
+     *
+     * @return ʸ»úÎóÊÑ´¹·ë²Ì
+     *
+     * @else
+     *
+     * @brief Convert PostFsmActionListenerType into the string.
+     *
+     * Convert PostFsmActionListenerType into the string.
+     *
+     * @param type The target PostFsmActionListenerType for transformation
+     *
+     * @return Trnasformation result of string representation
+     *
+     * @endif
+     */
+    static const char* toString(PostFsmActionListenerType type)
+    {
+      static const char* typeString[] =
+        {
+          "POST_ON_INIT",
+          "POST_ON_ENTRY",
+          "POST_ON_DO",
+          "POST_ON_EXIT",
+          "POST_ON_STATE_CHANGE",
+          "POST_FSM_ACTION_LISTENER_NUM"
+        };
+      if (type < POST_FSM_ACTION_LISTENER_NUM)
+        {
+          return typeString[type];
+        }
+      return "";
+    }
+
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~PostFsmActionListener();
+
+    /*!
+     * @if jp
+     *
+     * @brief ²¾ÁÛ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * PostFsmActionListener ¤Î¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * @else
+     *
+     * @brief Virtual Callback function
+     *
+     * This is a the Callback function for PostFsmActionListener.
+     *
+     * @endif
+     */
+    virtual void operator()(const char* state,
+                            ReturnCode_t ret) = 0;
+  };
+
+  //============================================================
+  /*!
+   * @if jp
+   * @brief FsmProfileListener ¤Î¥¿¥¤¥×
+   *
+   * - SET_FSM_PROFILE       : FSM ProfileÀßÄê»þ
+   * - GET_FSM_PROFILE       : FSM Profile¼èÆÀ»þ
+   * - ADD_FSM_STATE         : FSM¤ËState¤¬Äɲ䵤줿
+   * - REMOVE_FSM_STATE      : FSM¤«¤éState¤¬ºï½ü¤µ¤ì¤¿
+   * - ADD_FSM_TRANSITION    : FSM¤ËÁ«°Ü¤¬Äɲ䵤줿
+   * - REMOVE_FSM_TRANSITION : FSM¤«¤éÁ«°Ü¤¬ºï½ü¤µ¤ì¤¿
+   * - BIND_FSM_EVENT        : FSM¤Ë¥¤¥Ù¥ó¥È¤¬¥Ð¥¤¥ó¥É¤µ¤ì¤¿
+   * - UNBIND_FSM_EVENT      : FSM¤Ë¥¤¥Ù¥ó¥È¤¬¥¢¥ó¥Ð¥¤¥ó¥É¤µ¤ì¤¿
+   *
+   * @else
+   * @brief The types of FsmProfileListener
+   *
+   * - SET_FSM_PROFILE       : Setting FSM Profile
+   * - GET_FSM_PROFILE       : Getting FSM Profile
+   * - ADD_FSM_STATE         : A State added to the FSM
+   * - REMOVE_FSM_STATE      : A State removed from FSM
+   * - ADD_FSM_TRANSITION    : A transition added to the FSM
+   * - REMOVE_FSM_TRANSITION : A transition removed from FSM
+   * - BIND_FSM_EVENT        : An event bounded to the FSM
+   * - UNBIND_FSM_EVENT      : An event unbounded to the FSM
+   *
+   * @endif
+   */
+  enum FsmProfileListenerType
+    {
+      SET_FSM_PROFILE,
+      GET_FSM_PROFILE,
+      ADD_FSM_STATE,
+      REMOVE_FSM_STATE,
+      ADD_FSM_TRANSITION,
+      REMOVE_FSM_TRANSITION,
+      BIND_FSM_EVENT,
+      UNBIND_FSM_EVENT,
+      FSM_PROFILE_LISTENER_NUM
+    };
+
+  /*!
+   * @if jp
+   * @class FsmProfileListener ¥¯¥é¥¹
+   * @brief FsmProfileListener ¥¯¥é¥¹
+   *
+   * ³Æ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥æ¡¼¥¶¡¼¥³¡¼¥É¤¬¸Æ¤Ð¤ì¤ëľÁ°¤Î¥¿¥¤¥ß¥ó¥°
+   * ¤Ç¥³¡¼¥ë¤µ¤ì¤ë¥ê¥¹¤Ê¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¡£
+   *
+   * - ADD_PORT:
+   * - REMOVE_PORT:
+   *
+   * @else
+   * @class FsmProfileListener class
+   * @brief FsmProfileListener class
+   *
+   * This class is abstract base class for listener classes that
+   * provides callbacks for various events in rtobject.
+   *
+   * @endif
+   */
+  class FsmProfileListener
+  {
+  public:
+    /*!
+     * @if jp
+     *
+     * @brief FsmProfileListenerType ¤òʸ»úÎó¤ËÊÑ´¹
+     *
+     * FsmProfileListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë
+     *
+     * @param type ÊÑ´¹ÂÐ¾Ý FsmProfileListenerType
+     * @return ʸ»úÎóÊÑ´¹·ë²Ì
+     *
+     * @else
+     *
+     * @brief Convert FsmProfileListenerType into the string.
+     *
+     * Convert FsmProfileListenerType into the string.
+     *
+     * @param type The target FsmProfileListenerType for transformation
+     * @return Trnasformation result of string representation
+     *
+     * @endif
+     */
+    static const char* toString(FsmProfileListenerType type)
+    {
+      static const char* typeString[] =
+        {
+          "SET_FSM_PROFILE",
+          "GET_FSM_PROFILE",
+          "ADD_FSM_STATE",
+          "REMOVE_FSM_STATE",
+          "ADD_FSM_TRANSITION",
+          "REMOVE_FSM_TRANSITION",
+          "BIND_FSM_EVENT",
+          "UNBIND_FSM_EVENT",
+          "FSM_PROFILE_LISTENER_NUM"
+        };
+      if (type < FSM_PROFILE_LISTENER_NUM) { return typeString[type]; }
+      return "";
+    }
+
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~FsmProfileListener();
+
+    /*!
+     * @if jp
+     *
+     * @brief ²¾ÁÛ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * FsmProfileListener ¤Î¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * @else
+     *
+     * @brief Virtual Callback function
+     *
+     * This is a the Callback function for FsmProfileListener
+     *
+     * @endif
+     */
+    virtual void operator()(const ::RTC::FsmProfile& fsmprof) = 0;
+  };
+
+
+  //============================================================
+  /*!
+   * @if jp
+   * @brief FsmStructureListener ¤Î¥¿¥¤¥×
+   *
+   * - SET_FSM_STRUCTURE: FSM¹½Â¤¤ÎÀßÄê
+   * - GET_FSM_STRUCTURE: FSM¹½Â¤¤Î¼èÆÀ
+   *
+   * @else
+   * @brief The types of FsmStructureListener
+   *
+   * - SET_FSM_STRUCTURE: Setting FSM structure
+   * - GET_FSM_STRUCTURE: Getting FSM structure
+   *
+   * @endif
+   */
+  enum FsmStructureListenerType
+    {
+      SET_FSM_STRUCTURE,
+      GET_FSM_STRUCTURE,
+      FSM_STRUCTURE_LISTENER_NUM
+    };
+
+  /*!
+   * @if jp
+   * @class FsmStructureListener ¥¯¥é¥¹
+   * @brief FsmStructureListener ¥¯¥é¥¹
+   *
+   * ³Æ¥¢¥¯¥·¥ç¥ó¤ËÂбþ¤¹¤ë¥æ¡¼¥¶¡¼¥³¡¼¥É¤¬¸Æ¤Ð¤ì¤ëľÁ°¤Î¥¿¥¤¥ß¥ó¥°
+   * ¤Ç¥³¡¼¥ë¤µ¤ì¤ë¥ê¥¹¤Ê¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¡£
+   *
+   * @else
+   * @class FsmStructureListener class
+   * @brief FsmStructureListener class
+   *
+   * This class is abstract base class for listener classes that
+   * provides callbacks for various events in rtobject.
+   *
+   * @endif
+   */
+  class FsmStructureListener
+  {
+  public:
+    /*!
+     * @if jp
+     *
+     * @brief FsmStructureListenerType ¤òʸ»úÎó¤ËÊÑ´¹
+     *
+     * FsmStructureListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë
+     *
+     * @param type ÊÑ´¹ÂÐ¾Ý FsmStructureListenerType
+     *
+     * @return ʸ»úÎóÊÑ´¹·ë²Ì
+     *
+     * @else
+     *
+     * @brief Convert FsmStructureListenerType into the string.
+     *
+     * Convert FsmStructureListenerType into the string.
+     *
+     * @param type The target FsmStructureListenerType for transformation
+     *
+     * @return Trnasformation result of string representation
+     *
+     * @endif
+     */
+    static const char* toString(FsmStructureListenerType type)
+    {
+      static const char* typeString[] =
+        {
+          "SET_FSM_STRUCTURE",
+          "GET_FSM_STRUCTURE",
+          "FSM_STRUCTURE_LISTENER_NUM"
+        };
+      if (type < FSM_STRUCTURE_LISTENER_NUM) { return typeString[type]; }
+      return "";
+    }
+
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~FsmStructureListener();
+
+    /*!
+     * @if jp
+     *
+     * @brief ²¾ÁÛ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * FsmStructureListener ¤Î¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô
+     *
+     * @else
+     *
+     * @brief Virtual Callback function
+     *
+     * This is a the Callback function for FsmStructureListener
+     *
+     * @endif
+     */
+    virtual void operator()(::RTC::FsmStructure& pprof) = 0;
+  };
+
+
+  //============================================================
+  // Holder classes
+  //============================================================
+  /*!
+   * @if jp
+   * @class PreFsmActionListenerHolder
+   * @brief PreFsmActionListener ¥Û¥ë¥À¥¯¥é¥¹
+   *
+   * Ê£¿ô¤Î PreFsmActionListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤ë¥¯¥é¥¹¡£
+   *
+   * @else
+   * @class PreFsmActionListenerHolder
+   * @brief PreFsmActionListener holder class
+   *
+   * This class manages one ore more instances of
+   * PreFsmActionListener class.
+   *
+   * @endif
+   */
+  class PreFsmActionListenerHolder
+  {
+    typedef std::pair<PreFsmActionListener*, bool> Entry;
+    typedef coil::Guard<coil::Mutex> Guard;
+  public:
+    /*!
+     * @if jp
+     * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Constructor
+     * @endif
+     */
+    PreFsmActionListenerHolder();
+    
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~PreFsmActionListenerHolder();
+    
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ÎÄɲÃ
+     *
+     * ¥ê¥¹¥Ê¡¼¤òÄɲ乤롣
+     *
+     * @param listener Äɲ乤ë¥ê¥¹¥Ê
+     * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤¹¤ë,
+     *                  false:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤·¤Ê¤¤
+     * @else
+     *
+     * @brief Add the listener.
+     *
+     * This method adds the listener. 
+     *
+     * @param listener Added listener
+     * @param autoclean true:The listener is deleted at the destructor.,
+     *                  false:The listener is not deleted at the destructor. 
+     * @endif
+     */
+    void addListener(PreFsmActionListener* listener, bool autoclean);
+    
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤Îºï½ü
+     *
+     * ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     *
+     * @param listener ºï½ü¤¹¤ë¥ê¥¹¥Ê
+     * @else
+     *
+     * @brief Remove the listener. 
+     *
+     * This method removes the listener. 
+     *
+     * @param listener Removed listener
+     * @endif
+     */
+    void removeListener(PreFsmActionListener* listener);
+
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ØÄÌÃΤ¹¤ë
+     *
+     * ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
+     *
+     * @param info ConnectorInfo
+     * @else
+     *
+     * @brief Notify listeners. 
+     *
+     * This calls the Callback method of the registered listener. 
+     *
+     * @param info ConnectorInfo
+     * @endif
+     */
+    void notify(const char* state);
+      
+  private:
+    std::vector<Entry> m_listeners;
+    coil::Mutex m_mutex;
+  };
+
+
+  /*!
+   * @if jp
+   * @class PostFsmActionListenerHolder
+   * @brief PostFsmActionListener ¥Û¥ë¥À¥¯¥é¥¹
+   *
+   * Ê£¿ô¤Î PostFsmActionListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤ë¥¯¥é¥¹¡£
+   *
+   * @else
+   * @class PostFsmActionListenerHolder
+   * @brief PostFsmActionListener holder class
+   *
+   * This class manages one ore more instances of
+   * PostFsmActionListener class.
+   *
+   * @endif
+   */
+  class PostFsmActionListenerHolder
+  {
+    typedef std::pair<PostFsmActionListener*, bool> Entry;
+    typedef coil::Guard<coil::Mutex> Guard;
+  public:
+    /*!
+     * @if jp
+     * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Constructor
+     * @endif
+     */
+    PostFsmActionListenerHolder();
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~PostFsmActionListenerHolder();
+    
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ÎÄɲÃ
+     *
+     * ¥ê¥¹¥Ê¡¼¤òÄɲ乤롣
+     *
+     * @param listener Äɲ乤ë¥ê¥¹¥Ê
+     * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤¹¤ë,
+     *                  false:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤·¤Ê¤¤
+     * @else
+     *
+     * @brief Add the listener.
+     *
+     * This method adds the listener. 
+     *
+     * @param listener Added listener
+     * @param autoclean true:The listener is deleted at the destructor.,
+     *                  false:The listener is not deleted at the destructor. 
+     * @endif
+     */
+    void addListener(PostFsmActionListener* listener, bool autoclean);
+    
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤Îºï½ü
+     *
+     * ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     *
+     * @param listener ºï½ü¤¹¤ë¥ê¥¹¥Ê
+     * @else
+     *
+     * @brief Remove the listener. 
+     *
+     * This method removes the listener. 
+     *
+     * @param listener Removed listener
+     * @endif
+     */
+    void removeListener(PostFsmActionListener* listener);
+    
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ØÄÌÃΤ¹¤ë
+     *
+     * ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
+     *
+     * @param info ConnectorInfo
+     * @param cdrdata ¥Ç¡¼¥¿
+     * @else
+     *
+     * @brief Notify listeners. 
+     *
+     * This calls the Callback method of the registered listener. 
+     *
+     * @param info ConnectorInfo
+     * @param cdrdata Data
+     * @endif
+     */
+    void notify(const char* state, ReturnCode_t ret);
+    
+  private:
+    std::vector<Entry> m_listeners;
+    coil::Mutex m_mutex;
+  };
+
+
+  //============================================================
+  /*!
+   * @if jp
+   * @class FsmProfileListenerHolder
+   * @brief FsmProfileListener ¥Û¥ë¥À¥¯¥é¥¹
+   *
+   * Ê£¿ô¤Î FsmProfileListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤ë¥¯¥é¥¹¡£
+   *
+   * @else
+   * @class FsmProfileListenerHolder
+   * @brief FsmProfileListener holder class
+   *
+   * This class manages one ore more instances of
+   * FsmProfileListener class.
+   *
+   * @endif
+   */
+  class FsmProfileListenerHolder
+  {
+    typedef std::pair<FsmProfileListener*, bool> Entry;
+    typedef coil::Guard<coil::Mutex> Guard;
+  public:
+    /*!
+     * @if jp
+     * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Constructor
+     * @endif
+     */
+    FsmProfileListenerHolder();
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~FsmProfileListenerHolder();
+
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ÎÄɲÃ
+     *
+     * ¥ê¥¹¥Ê¡¼¤òÄɲ乤롣
+     *
+     * @param listener Äɲ乤ë¥ê¥¹¥Ê
+     * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤¹¤ë,
+     *                  false:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤·¤Ê¤¤
+     * @else
+     *
+     * @brief Add the listener.
+     *
+     * This method adds the listener.
+     *
+     * @param listener Added listener
+     * @param autoclean true:The listener is deleted at the destructor.,
+     *                  false:The listener is not deleted at the destructor.
+     * @endif
+     */
+    void addListener(FsmProfileListener* listener, bool autoclean);
+
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤Îºï½ü
+     *
+     * ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     *
+     * @param listener ºï½ü¤¹¤ë¥ê¥¹¥Ê
+     * @else
+     *
+     * @brief Remove the listener.
+     *
+     * This method removes the listener.
+     *
+     * @param listener Removed listener
+     * @endif
+     */
+    void removeListener(FsmProfileListener* listener);
+
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ØÄÌÃΤ¹¤ë
+     *
+     * ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
+     *
+     * @param info ConnectorInfo
+     * @param cdrdata ¥Ç¡¼¥¿
+     * @else
+     *
+     * @brief Notify listeners. 
+     *
+     * This calls the Callback method of the registered listener. 
+     *
+     * @param info ConnectorInfo
+     * @param cdrdata Data
+     * @endif
+     */
+    void notify(RTC::FsmProfile& profile);
+
+  private:
+    std::vector<Entry> m_listeners;
+    coil::Mutex m_mutex;
+  };
+
+  /*!
+   * @if jp
+   * @class FsmStructureListenerHolder
+   * @brief FsmStructureListener ¥Û¥ë¥À¥¯¥é¥¹
+   *
+   * Ê£¿ô¤Î FsmStructureListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤ë¥¯¥é¥¹¡£
+   *
+   * @else
+   * @class FsmStructureListenerHolder
+   * @brief FsmStructureListener holder class
+   *
+   * This class manages one ore more instances of
+   * FsmStructureListener class.
+   *
+   * @endif
+   */
+  class FsmStructureListenerHolder
+  {
+    typedef std::pair<FsmStructureListener*, bool> Entry;
+    typedef coil::Guard<coil::Mutex> Guard;
+  public:
+    /*!
+     * @if jp
+     * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Constructor
+     * @endif
+     */
+    FsmStructureListenerHolder();
+    /*!
+     * @if jp
+     * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+     * @else
+     * @brief Destructor
+     * @endif
+     */
+    virtual ~FsmStructureListenerHolder();
+
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ÎÄɲÃ
+     *
+     * ¥ê¥¹¥Ê¡¼¤òÄɲ乤롣
+     *
+     * @param listener Äɲ乤ë¥ê¥¹¥Ê
+     * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤¹¤ë,
+     *                  false:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤·¤Ê¤¤
+     * @else
+     *
+     * @brief Add the listener.
+     *
+     * This method adds the listener.
+     *
+     * @param listener Added listener
+     * @param autoclean true:The listener is deleted at the destructor.,
+     *                  false:The listener is not deleted at the destructor.
+     * @endif
+     */
+    void addListener(FsmStructureListener* listener, bool autoclean);
+
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤Îºï½ü
+     *
+     * ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     *
+     * @param listener ºï½ü¤¹¤ë¥ê¥¹¥Ê
+     * @else
+     *
+     * @brief Remove the listener.
+     *
+     * This method removes the listener.
+     *
+     * @param listener Removed listener
+     * @endif
+     */
+    void removeListener(FsmStructureListener* listener);
+
+    /*!
+     * @if jp
+     *
+     * @brief ¥ê¥¹¥Ê¡¼¤ØÄÌÃΤ¹¤ë
+     *
+     * ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
+     *
+     * @param info ConnectorInfo
+     * @param cdrdata ¥Ç¡¼¥¿
+     * @else
+     *
+     * @brief Notify listeners. 
+     *
+     * This calls the Callback method of the registered listener. 
+     *
+     * @param info ConnectorInfo
+     * @param cdrdata Data
+     * @endif
+     */
+    void notify(RTC::FsmStructure& structure);
+
+  private:
+    std::vector<Entry> m_listeners;
+    coil::Mutex m_mutex;
+  };
+
+  //============================================================
+  /*!
+   * @if jp
+   * @class FsmActionListeners
+   * @brief FsmActionListeners ¥¯¥é¥¹
+   *
+   *
+   * @else
+   * @class FsmActionListeners
+   * @brief FsmActionListeners class
+   *
+   *
+   * @endif
+   */
+  class FsmActionListeners
+  {
+  public:
+    /*!
+     * @if jp
+     * @brief PreFsmActionListenerType¥ê¥¹¥ÊÇÛÎó
+     * PreFsmActionListenerType¥ê¥¹¥Ê¤ò³ÊǼ
+     * @else
+     * @brief PreFsmActionListenerType listener array
+     * The PreFsmActionListenerType listener is stored. 
+     * @endif
+     */
+    PreFsmActionListenerHolder 
+    preaction_[PRE_FSM_ACTION_LISTENER_NUM];
+    /*!
+     * @if jp
+     * @brief PostFsmActionType¥ê¥¹¥ÊÇÛÎó
+     * PostFsmActionType¥ê¥¹¥Ê¤ò³ÊǼ
+     * @else
+     * @brief PostFsmActionType listener array
+     * The PostFsmActionType listener is stored.
+     * @endif
+     */
+    PostFsmActionListenerHolder 
+    postaction_[POST_FSM_ACTION_LISTENER_NUM];
+    /*!
+     * @if jp
+     * @brief FsmProfileType¥ê¥¹¥ÊÇÛÎó
+     * FsmProfileType¥ê¥¹¥Ê¤ò³ÊǼ
+     * @else
+     * @brief FsmProfileType listener array
+     * The FsmProfileType listener is stored.
+     * @endif
+     */
+    FsmProfileListenerHolder
+    profile_[FSM_PROFILE_LISTENER_NUM];
+    /*!
+     * @if jp
+     * @brief FsmStructureType¥ê¥¹¥ÊÇÛÎó
+     * FsmStructureType¥ê¥¹¥Ê¤ò³ÊǼ
+     * @else
+     * @brief FsmStructureType listener array
+     * The FsmStructureType listener is stored.
+     * @endif
+     */
+    FsmStructureListenerHolder
+    structure_[FSM_STRUCTURE_LISTENER_NUM];
+  };
+
+}; // namespace RTC
+
+#endif // RTC_FSMACTIONLISTENER_H

Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp	2017-12-10 21:18:08 UTC (rev 3115)
@@ -44,7 +44,7 @@
       {
         m_buffer = createBuffer(info);
       }
-    if (m_buffer == 0 || m_provider==0) throw std::bad_alloc();
+    if (m_buffer == 0 || m_provider == 0) { throw std::bad_alloc(); }
 
     m_buffer->init(info.properties.getNode("buffer"));
     m_provider->init(info.properties);

Modified: trunk/OpenRTM-aist/src/lib/rtm/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Makefile.am	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/rtm/Makefile.am	2017-12-10 21:18:08 UTC (rev 3115)
@@ -85,6 +85,7 @@
 	RTObject.cpp                 \
 	ConfigAdmin.cpp              \
 	ComponentActionListener.cpp  \
+	FsmActionListener.cpp        \
 	ConfigurationListener.cpp    \
 	SdoConfiguration.cpp         \
 	SdoServiceAdmin.cpp          \

Modified: trunk/OpenRTM-aist/src/lib/rtm/NVUtil.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NVUtil.cpp	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/rtm/NVUtil.cpp	2017-12-10 21:18:08 UTC (rev 3115)
@@ -123,7 +123,7 @@
 #else // ORB_IS_RTORB
         nv[i].name = (char *)keys[i].c_str();
 #endif // ORB_IS_RTORB
-	nv[i].value <<= prop[keys[i]].c_str();
+        nv[i].value <<= prop[keys[i]].c_str();
       }
   }
   
@@ -138,12 +138,12 @@
   {
     for (CORBA::ULong i(0), len(nv.length()); i < len; ++i)
       {
-	const char* value;
-	if (nv[i].value >>= value)
-	  {
-	    const char* name(nv[i].name);
-	    prop[name] = value;
-	  };
+        const char* value;
+        if (nv[i].value >>= value)
+          {
+            const char* name(nv[i].name);
+            prop[name] = value;
+          };
       }
   }
   
@@ -163,9 +163,9 @@
     {
       const char* value;
       if (nv.value >>= value)
-	{
-	  m_prop.setProperty(CORBA::string_dup(nv.name), value);
-	};
+        {
+          m_prop.setProperty(CORBA::string_dup(nv.name), value);
+        }
     }
     coil::Properties m_prop;
   };
@@ -240,14 +240,14 @@
   {
     try
       {
-	CORBA::Any value;
-	value = find(nv, name);
-	const char* str_value;
-	return value >>= str_value;
+        CORBA::Any value;
+        value = find(nv, name);
+        const char* str_value;
+        return value >>= str_value;
       }
     catch (...)
       {
-	return false;
+        return false;
       }
   }
   
@@ -260,14 +260,14 @@
    * @endif
    */
   bool isStringValue(const SDOPackage::NVList& nv,
-		     const char* name, const char* value)
+                     const char* name, const char* value)
   {
     if (isString(nv, name))
       {
-	if (toString(nv, name) == value)
-	  {
-	    return true;
-	  }
+        if (toString(nv, name) == value)
+          {
+            return true;
+          }
       }
     return false;
   }
@@ -284,19 +284,19 @@
     const char* str_value;
     try
       {
-	if(!(find(nv, name) >>= str_value))
+        if(!(find(nv, name) >>= str_value))
           {
-	    str_value = "";
+            str_value = "";
           }
       }
     catch (...)
       {
-	str_value = "";
+        str_value = "";
       }
 
     if (str_value == NULL)
       {
-	str_value = "";
+        str_value = "";
       }
     
     return str_value;
@@ -324,22 +324,22 @@
     
     if (index < 0)
       {
-	CORBA_SeqUtil::push_back(nv, newNV(name, value));
+        CORBA_SeqUtil::push_back(nv, newNV(name, value));
       }
     else
       {
-	const char* tmp_char;
-	nv[index].value >>= tmp_char;
-	std::string tmp_str(tmp_char);
-	
-	std::vector<std::string> values;
-	values = coil::split(tmp_str, ",");
-	if (values.end() == std::find(values.begin(), values.end(), value))
-	  {
-	    tmp_str.append(",");
-	    tmp_str.append(value);
-	    nv[index].value <<= tmp_str.c_str();
-	  }
+        const char* tmp_char;
+        nv[index].value >>= tmp_char;
+        std::string tmp_str(tmp_char);
+        
+        std::vector<std::string> values;
+        values = coil::split(tmp_str, ",");
+        if (values.end() == std::find(values.begin(), values.end(), value))
+          {
+            tmp_str.append(",");
+            tmp_str.append(value);
+            nv[index].value <<= tmp_str.c_str();
+          }
       }
     return true;
   }
@@ -355,33 +355,56 @@
   {
     for (CORBA::ULong i = 0, len = src.length(); i < len; ++i)
       {
-	CORBA_SeqUtil::push_back(dest, src[i]);
+        CORBA_SeqUtil::push_back(dest, src[i]);
       }
   }
   
   /*!
    * @if jp
+   * @brief NameValue ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£
+   * @else
+   * @brief Print information configured in NVList as a string type
+   * @endif
+   */
+  std::ostream& dump_to_stream(std::ostream& out,
+                               const SDOPackage::NameValue& nv)
+  {
+    const char* str_value;
+    if (nv.value >>= str_value)
+      {
+        out << nv.name << ": " << str_value << std::endl;
+      }
+    else
+      {
+        out << nv.name << ": not a string value" << std::endl;
+      }
+    return out;
+  }
+  std::ostream& operator<<(std::ostream& os, const SDOPackage::NameValue& nv)
+  {
+    return dump_to_stream(os, nv);
+  }
+
+  /*!
+   * @if jp
    * @brief NVList ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£
    * @else
    * @brief Print information configured in NVList as a string type
    * @endif
    */
-  std::ostream& dump_to_stream(std::ostream& out, const SDOPackage::NVList& nv)
+  std::ostream& dump_to_stream(std::ostream& out,
+                               const SDOPackage::NVList& nv)
   {
     for (CORBA::ULong i(0), n(nv.length()); i < n; ++i)
       {
-	const char* str_value;
-	if (nv[i].value >>= str_value)
-	  {
-	    out << nv[i].name << ": " << str_value << std::endl;
-	  }
-	else
-	  {
-	    out << nv[i].name << ": not a string value" << std::endl;
-	  }
+        out << nv[i] << std::endl;
       }
     return out;
   }
+  std::ostream& operator<<(std::ostream& os, const SDOPackage::NVList& nvlist)
+  {
+    return dump_to_stream(os, nvlist);
+  }
 
   /*!
    * @if jp

Modified: trunk/OpenRTM-aist/src/lib/rtm/NVUtil.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NVUtil.h	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/rtm/NVUtil.h	2017-12-10 21:18:08 UTC (rev 3115)
@@ -536,8 +536,60 @@
   /*!
    * @if jp
    *
+   * @brief NameValue ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£
+   *
+   * »ØÄꤵ¤ì¤¿ NVList ¤ËÀßÄꤵ¤ì¤¿ÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£¤Ê¤ª¡¢Àß
+   * Äꤵ¤ì¤Æ¤¤¤ëÍ×ÁǤ¬Ê¸»úÎ󷿰ʳ°¤Î¾ì¹ç¤Ë¤Ï¡¢¤½¤Î»Ý(ʸ»úÎó¤Ç¤Ï¤Ê¤¤)¤ò
+   * ½ÐÎϤ¹¤ë¡£
+   *
+   * @param nv ½ÐÎÏÂÐ¾Ý NameValue
+   *
+   * @else
+   *
+   * @brief Print information configured in NameValue as string type
+   *
+   * Print configured information as string type in specified NVList.
+   * Also, print the reason (this is not string type) if the configured
+   * element is other than string type.
+   *
+   * @param nv The target NameValue for the print
+   *
+   * @endif
+   */
+  std::ostream& dump_to_stream(std::ostream& out,
+                               const SDOPackage::NameValue& nv);
+  std::ostream& operator<<(std::ostream& os, const SDOPackage::NameValue& nv);
+
+/*!
+   * @if jp
+   *
    * @brief NVList ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£
    *
+   * »ØÄꤵ¤ì¤¿ NVList ¤ËÀßÄꤵ¤ì¤¿ÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£¤Ê¤ª¡¢Àß
+   * Äꤵ¤ì¤Æ¤¤¤ëÍ×ÁǤ¬Ê¸»úÎ󷿰ʳ°¤Î¾ì¹ç¤Ë¤Ï¡¢¤½¤Î»Ý(ʸ»úÎó¤Ç¤Ï¤Ê¤¤)¤ò
+   * ½ÐÎϤ¹¤ë¡£
+   *
+   * @param nv ½ÐÎÏÂÐ¾Ý NVList
+   *
+   * @else
+   *
+   * @brief Print information configured in NVList as string type
+   *
+   * Print configured information as string type in specified NVList.
+   * Also, print the reason (this is not string type) if the configured
+   * element is other than string type.
+   *
+   * @param nv The target NVList for the print
+   *
+   * @endif
+   */
+  std::ostream& operator<<(std::ostream& os, const SDOPackage::NVList& nvlist);
+
+  /*!
+   * @if jp
+   *
+   * @brief NVList ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£
+   *
    * »ØÄꤵ¤ì¤¿ NVList ¤ËÀßÄꤵ¤ì¤¿ÆâÍƤòʸ»úÎó¤È¤·¤Æ½ÐÎϤ¹¤ë¡£
    * ¤Ê¤ª¡¢ÀßÄꤵ¤ì¤Æ¤¤¤ëÍ×ÁǤ¬Ê¸»úÎ󷿰ʳ°¤Î¾ì¹ç¤Ë¤Ï¡¢¤½¤Î»Ý(ʸ»úÎó¤Ç¤Ï¤Ê¤¤)¤ò
    * ½ÐÎϤ¹¤ë¡£
@@ -588,7 +640,7 @@
    * @endif
    */
   std::string toString(const SDOPackage::NVList& nv);
-  
 
+
 };
 #endif // NVUTIL_NVUTIL_H

Modified: trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp	2017-12-10 21:18:08 UTC (rev 3115)
@@ -2482,10 +2482,157 @@
   {
     m_configsets.removeConfigurationSetNameListener(type, listener);
   }
+
+  //============================================================
+  // FSM Listener
+  /*!
+   * @if jp
+   * @brief PreFsmActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+   *
+   * @else
+   * @brief Adding PreFsmAction type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  addPreFsmActionListener(PreFsmActionListenerType listener_type,
+                          PreFsmActionListener* listener,
+                          bool autoclean)
+  {
+    m_fsmActionListeners.
+      preaction_[listener_type].addListener(listener, autoclean);
+  }
   
   
   /*!
    * @if jp
+   * @brief PreFsmActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+   *
+   * @else
+   * @brief Removing PreFsmAction type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  removePreFsmActionListener(PreFsmActionListenerType listener_type,
+                             PreFsmActionListener* listener)
+  {
+    m_fsmActionListeners.
+      preaction_[listener_type].removeListener(listener);
+  }
+
+
+  /*!
+   * @if jp
+   * @brief PostFsmActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+   *
+   * @else
+   * @brief Adding PostFsmAction type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  addPostFsmActionListener(PostFsmActionListenerType listener_type,
+                           PostFsmActionListener* listener,
+                           bool autoclean)
+  {
+    m_fsmActionListeners.
+      postaction_[listener_type].addListener(listener, autoclean);
+  }
+
+
+  /*!
+   * @if jp
+   * @brief PostFsmActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+   *
+   * @else
+   * @brief Removing PostFsmAction type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  removePostFsmActionListener(PostFsmActionListenerType listener_type,
+                              PostFsmActionListener* listener)
+  {
+    m_fsmActionListeners.
+      postaction_[listener_type].removeListener(listener);
+  }
+
+  /*!
+   * @if jp
+   * @brief FsmProfileListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+   *
+   * @else
+   * @brief Adding FsmProfile type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  addFsmProfileListener(FsmProfileListenerType listener_type,
+                          FsmProfileListener* listener,
+                          bool autoclean)
+  {
+    m_fsmActionListeners.
+      profile_[listener_type].addListener(listener, autoclean);
+  }
+
+
+  /*!
+   * @if jp
+   * @brief FsmProfileListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+   *
+   * @else
+   * @brief Removing FsmProfile type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  removeFsmProfileListener(FsmProfileListenerType listener_type,
+                             FsmProfileListener* listener)
+  {
+    m_fsmActionListeners.
+      profile_[listener_type].removeListener(listener);
+  }
+
+  /*!
+   * @if jp
+   * @brief FsmStructureListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+   *
+   * @else
+   * @brief Adding FsmStructure type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  addFsmStructureListener(FsmStructureListenerType listener_type,
+                          FsmStructureListener* listener,
+                          bool autoclean)
+  {
+    m_fsmActionListeners.
+      structure_[listener_type].addListener(listener, autoclean);
+  }
+
+
+  /*!
+   * @if jp
+   * @brief FsmStructureListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+   *
+   * @else
+   * @brief Removing FsmStructure type listener
+   *
+   * @endif
+   */
+  void RTObject_impl::
+  removeFsmStructureListener(FsmStructureListenerType listener_type,
+                             FsmStructureListener* listener)
+  {
+    m_fsmActionListeners.
+      structure_[listener_type].removeListener(listener);
+  }
+
+  
+  /*!
+   * @if jp
    * @brief RTC ¤ò½ªÎ»¤¹¤ë
    * @else
    * @brief Shutdown RTC

Modified: trunk/OpenRTM-aist/src/lib/rtm/RTObject.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTObject.h	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTObject.h	2017-12-10 21:18:08 UTC (rev 3115)
@@ -34,6 +34,7 @@
 #include <rtm/ComponentActionListener.h>
 #include <rtm/SdoServiceAdmin.h>
 #include <rtm/PortConnectListener.h>
+#include <rtm/FsmActionListener.h>
 
 #define ECOTHER_OFFSET 1000
 
@@ -3449,8 +3450,8 @@
     typedef PreComponentActionListener PreCompActionListener;
     typedef PreComponentActionListenerType PreCompActionListenerType;
     void 
-    addPreComponentActionListener(PreComponentActionListenerType listener_type,
-                                  PreComponentActionListener* listener,
+    addPreComponentActionListener(PreCompActionListenerType listener_type,
+                                  PreCompActionListener* listener,
                                   bool autoclean = true);
 
 
@@ -4382,7 +4383,510 @@
     void
     removeConfigurationSetNameListener(ConfigurationSetNameListenerType type,
                                        ConfigurationSetNameListener* listener);
-    
+
+    //============================================================
+    // FSM Listener
+    /*!
+     * @if jp
+     * @brief PreFsmActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+     *
+     * FsmAction ¼ÂÁõ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·Ä¾Á°¤Î¥¤¥Ù¥ó¥È¤Ë´ØÏ¢¤¹¤ë³Æ¼ï¥ê
+     * ¥¹¥Ê¤òÀßÄꤹ¤ë¡£
+     *
+     * ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê
+     *
+     * - PRE_ON_INITIALIZE:    onInitialize ľÁ°
+     * - PRE_ON_FINALIZE:      onFinalize ľÁ°
+     * - PRE_ON_STARTUP:       onStartup ľÁ°
+     * - PRE_ON_SHUTDOWN:      onShutdown ľÁ°
+     * - PRE_ON_ACTIVATED:     onActivated ľÁ°
+     * - PRE_ON_DEACTIVATED:   onDeactivated ľÁ°
+     * - PRE_ON_ABORTED:       onAborted ľÁ°
+     * - PRE_ON_ERROR:         onError ľÁ°
+     * - PRE_ON_RESET:         onReset ľÁ°
+     * - PRE_ON_EXECUTE:       onExecute ľÁ°
+     * - PRE_ON_STATE_UPDATE:  onStateUpdate ľÁ°
+     *
+     * ¥ê¥¹¥Ê¤Ï PreFsmActionListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä
+     * operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
+     *
+     * PreFsmActionListener::operator()(UniqueId ec_id)
+     *
+     * ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï
+     * RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢
+     * removePreFsmActionListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£
+     * ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú
+     * ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+     *
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     * @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥°
+     *
+     * @else
+     * @brief Adding PreFsmAction type listener
+     *
+     * This operation adds certain listeners related to FsmActions
+     * pre events.
+     * The following listener types are available.
+     *
+     * - PRE_ON_INITIALIZE:    before onInitialize
+     * - PRE_ON_FINALIZE:      before onFinalize
+     * - PRE_ON_STARTUP:       before onStartup
+     * - PRE_ON_SHUTDOWN:      before onShutdown
+     * - PRE_ON_ACTIVATED:     before onActivated
+     * - PRE_ON_DEACTIVATED:   before onDeactivated
+     * - PRE_ON_ABORTED:       before onAborted
+     * - PRE_ON_ERROR:         before onError
+     * - PRE_ON_RESET:         before onReset
+     * - PRE_ON_EXECUTE:       before onExecute
+     * - PRE_ON_STATE_UPDATE:  before onStateUpdate
+     *
+     * Listeners should have the following function operator().
+     *
+     * PreFsmActionListener::operator()(UniqueId ec_id)
+     *
+     * The ownership of the given listener object is transferred to
+     * this RTObject object in default.  The given listener object will
+     * be destroied automatically in the RTObject's dtor or if the
+     * listener is deleted by removePreFsmActionListener() function.
+     * If you want to keep ownership of the listener object, give
+     * "false" value to 3rd argument to inhibit automatic destruction.
+     *
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     * @param autoclean A flag for automatic listener destruction
+     *
+     * @endif
+     */
+    void 
+    addPreFsmActionListener(PreFsmActionListenerType listener_type,
+                                  PreFsmActionListener* listener,
+                                  bool autoclean = true);
+
+
+    template <class Listener>
+    PreFsmActionListener*
+    addPreFsmActionListener(PreFsmActionListenerType listener_type,
+                                   Listener& obj,
+                                   void (Listener::*memfunc)(const char* state))
+    {
+      class Noname
+        : public PreFsmActionListener
+      {
+      public:
+        Noname(Listener& obj, void (Listener::*memfunc)(const char*))
+          : m_obj(obj), m_memfunc(memfunc)
+        {
+        }
+        void operator()(const char* state)
+        {
+          (m_obj.*m_memfunc)(state);
+        }
+      private:
+        Listener& m_obj;
+        typedef void (Listener::*Memfunc)(const char* state);
+        Memfunc m_memfunc;
+      };
+      Noname* listener(new Noname(obj, memfunc));
+      addPreFsmActionListener(listener_type, listener, true);
+      return listener;
+    }
+
+    /*!
+     * @if jp
+     * @brief PreFsmActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+     *
+     * ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     * 
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     *
+     * @else
+     * @brief Removing PreFsmAction type listener
+     *
+     * This operation removes a specified listener.
+     *     
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     *
+     * @endif
+     */
+    void
+    removePreFsmActionListener(
+                               PreFsmActionListenerType listener_type,
+                               PreFsmActionListener* listener);
+
+
+    /*!
+     * @if jp
+     * @brief PostFsmActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+     *
+     * FsmAction ¼ÂÁõ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·Ä¾¸å¤Î¥¤¥Ù¥ó¥È¤Ë´ØÏ¢¤¹¤ë³Æ¼ï¥ê
+     * ¥¹¥Ê¤òÀßÄꤹ¤ë¡£
+     *
+     * ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê
+     *
+     * - POST_ON_INITIALIZE:    onInitialize ľ¸å
+     * - POST_ON_FINALIZE:      onFinalize ľ¸å
+     * - POST_ON_STARTUP:       onStartup ľ¸å
+     * - POST_ON_SHUTDOWN:      onShutdown ľ¸å
+     * - POST_ON_ACTIVATED:     onActivated ľ¸å
+     * - POST_ON_DEACTIVATED:   onDeactivated ľ¸å
+     * - POST_ON_ABORTED:       onAborted ľ¸å
+     * - POST_ON_ERROR:         onError ľ¸å
+     * - POST_ON_RESET:         onReset ľ¸å
+     * - POST_ON_EXECUTE:       onExecute ľ¸å
+     * - POST_ON_STATE_UPDATE:  onStateUpdate ľ¸å
+     *
+     * ¥ê¥¹¥Ê¤Ï PostFsmActionListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä
+     * operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
+     *
+     * PostFsmActionListener::operator()(const char* state, ReturnCode_t ret)
+     *
+     * ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï
+     * RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢
+     * removePostFsmActionListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£
+     * ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú
+     * ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+     *
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     * @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥°
+     *
+     * @else
+     * @brief Adding PostFsmAction type listener
+     *
+     * This operation adds certain listeners related to FsmActions
+     * post events.
+     * The following listener types are available.
+     *
+     * - POST_ON_INITIALIZE:    after onInitialize
+     * - POST_ON_FINALIZE:      after onFinalize
+     * - POST_ON_STARTUP:       after onStartup
+     * - POST_ON_SHUTDOWN:      after onShutdown
+     * - POST_ON_ACTIVATED:     after onActivated
+     * - POST_ON_DEACTIVATED:   after onDeactivated
+     * - POST_ON_ABORTED:       after onAborted
+     * - POST_ON_ERROR:         after onError
+     * - POST_ON_RESET:         after onReset
+     * - POST_ON_EXECUTE:       after onExecute
+     * - POST_ON_STATE_UPDATE:  after onStateUpdate
+     *
+     * Listeners should have the following function operator().
+     *
+     * PostFsmActionListener::operator()(const char* state, ReturnCode_t ret)
+     *
+     * The ownership of the given listener object is transferred to
+     * this RTObject object in default.  The given listener object will
+     * be destroied automatically in the RTObject's dtor or if the
+     * listener is deleted by removePostFsmActionListener() function.
+     * If you want to keep ownership of the listener object, give
+     * "false" value to 3rd argument to inhibit automatic destruction.
+     *
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     * @param autoclean A flag for automatic listener destruction
+     *
+     * @endif
+     */
+    void
+    addPostFsmActionListener(PostFsmActionListenerType listener_type,
+                             PostFsmActionListener* listener,
+                               bool autoclean = true);
+
+    template <class Listener>
+    PostFsmActionListener*
+    addPostFsmActionListener(PostFsmActionListenerType listener_type,
+                             Listener& obj,
+                             void (Listener::*memfunc)(const char* state,
+                                                       ReturnCode_t ret))
+    {
+      class Noname
+        : public PostFsmActionListener
+      {
+      public:
+        Noname(Listener& obj,
+               void (Listener::*memfunc)(const char*, ReturnCode_t))
+          : m_obj(obj), m_memfunc(memfunc)
+        {
+        }
+        void operator()(const char* state, ReturnCode_t ret)
+        {
+          (m_obj.*m_memfunc)(state, ret);
+        }
+      private:
+        Listener& m_obj;
+        typedef void (Listener::*Memfunc)(const char* state, ReturnCode_t ret);
+        Memfunc m_memfunc;
+      };
+      Noname* listener(new Noname(obj, memfunc));
+      addPostFsmActionListener(listener_type, listener, true);
+      return listener;
+    }
+
+    /*!
+     * @if jp
+     * @brief PostFsmActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+     *
+     * ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     *
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     *
+     * @else
+     * @brief Removing PostFsmAction type listener
+     *
+     * This operation removes a specified listener.
+     *
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     *
+     * @endif
+     */
+    void
+    removePostFsmActionListener(PostFsmActionListenerType listener_type,
+                                PostFsmActionListener* listener);
+
+    /*!
+     * @if jp
+     * @brief FsmProfileListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+     *
+     * FSM¤Ø¤Î¥×¥í¥Õ¥¡¥¤¥ë¤ÎÀßÄê¡¢¼èÆÀ»þ¡¢¤Þ¤¿FSM¼«ÂΤؤξõÂÖ¤äÁ«°Ü¡¢¥¤
+     * ¥Ù¥ó¥È¤ÎÄɲúï½ü»þ¤Ë¥³¡¼¥ë¥Ð¥Ã¥¯¤µ¤ì¤ë³Æ¼ï¥ê¥¹¥Ê¤òÀßÄꤹ¤ë¡£
+     *
+     * ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê
+     *
+     * - SET_FSM_PROFILE       : FSM ProfileÀßÄê»þ
+     * - GET_FSM_PROFILE       : FSM Profile¼èÆÀ»þ
+     * - ADD_FSM_STATE         : FSM¤ËState¤¬Äɲ䵤줿
+     * - REMOVE_FSM_STATE      : FSM¤«¤éState¤¬ºï½ü¤µ¤ì¤¿
+     * - ADD_FSM_TRANSITION    : FSM¤ËÁ«°Ü¤¬Äɲ䵤줿
+     * - REMOVE_FSM_TRANSITION : FSM¤«¤éÁ«°Ü¤¬ºï½ü¤µ¤ì¤¿
+     * - BIND_FSM_EVENT        : FSM¤Ë¥¤¥Ù¥ó¥È¤¬¥Ð¥¤¥ó¥É¤µ¤ì¤¿
+     * - UNBIND_FSM_EVENT      : FSM¤Ë¥¤¥Ù¥ó¥È¤¬¥¢¥ó¥Ð¥¤¥ó¥É¤µ¤ì¤¿
+     *
+     * ¥ê¥¹¥Ê¤Ï FsmProfileListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä
+     * operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
+     *
+     * FsmProfileListener::operator()(RTC::FsmProfile& pprof)
+     *
+     * ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï
+     * RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢
+     * removeFsmProfileListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£
+     * ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú
+     * ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+     *
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     * @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥°
+     *
+     * @else
+     * @brief Adding FsmProfile type listener
+     *
+     * This operation adds certain listeners that is called when
+     * setting/getting FsmProfile and stae/transition/event add/remove
+     * to/from the FSM itself.
+     *
+     * The following listener types are available.
+     *
+     * - SET_FSM_PROFILE       : Setting FSM Profile
+     * - GET_FSM_PROFILE       : Getting FSM Profile
+     * - ADD_FSM_STATE         : A State added to the FSM
+     * - REMOVE_FSM_STATE      : A State removed from FSM
+     * - ADD_FSM_TRANSITION    : A transition added to the FSM
+     * - REMOVE_FSM_TRANSITION : A transition removed from FSM
+     * - BIND_FSM_EVENT        : An event bounded to the FSM
+     * - UNBIND_FSM_EVENT      : An event unbounded to the FSM
+     *
+     * Listeners should have the following function operator().
+     *
+     * FsmProfileListener::operator()(RTC::PortProfile pprof)
+     *
+     * The ownership of the given listener object is transferred to
+     * this RTObject object in default.  The given listener object will
+     * be destroied automatically in the RTObject's dtor or if the
+     * listener is deleted by removeFsmProfileListener() function.
+     * If you want to keep ownership of the listener object, give
+     * "false" value to 3rd argument to inhibit automatic destruction.
+     *
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     * @param autoclean A flag for automatic listener destruction
+     *
+     * @endif
+     */
+    void
+    addFsmProfileListener(FsmProfileListenerType listener_type,
+                          FsmProfileListener* listener,
+                          bool autoclean = true);
+
+    template <class Listener>
+    FsmProfileListener*
+    addFsmProfileListener(FsmProfileListenerType listener_type,
+                          Listener& obj,
+                          void (Listener::*memfunc)(const RTC::PortProfile&))
+    {
+      class Noname
+        : public FsmProfileListener
+      {
+      public:
+        Noname(Listener& obj,
+               void (Listener::*memfunc)(const RTC::FsmProfile&))
+          : m_obj(obj), m_memfunc(memfunc)
+        {
+        }
+        void operator()(const RTC::PortProfile& pprofile)
+        {
+          (m_obj.*m_memfunc)(pprofile);
+        }
+      private:
+        Listener& m_obj;
+        typedef void (Listener::*Memfunc)(const RTC::FsmProfile&);
+        Memfunc m_memfunc;
+      };
+      Noname* listener(new Noname(obj, memfunc));
+      addFsmProfileListener(listener_type, listener, true);
+      return listener;
+    }
+
+    /*!
+     * @if jp
+     * @brief FsmProfileListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+     *
+     * ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     *
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     *
+     * @else
+     * @brief Removing FsmProfile type listener
+     *
+     * This operation removes a specified listener.
+     *
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     *
+     * @endif
+     */
+    void
+    removeFsmProfileListener(FsmProfileListenerType listener_type,
+                             FsmProfileListener* listener);
+
+
+    /*!
+     * @if jp
+     * @brief FsmStructureListener ¥ê¥¹¥Ê¤òÄɲ乤ë
+     *
+     * ExtendedFsmService ¤Ë´ØÏ¢¤¹¤ë FSM structure ¤ÎÀßÄꡦ¼èÆÀ»þ¤Ë¥³¡¼
+     * ¥ë¥Ð¥Ã¥¯¤µ¤ì¤ë³Æ¼ï¥ê¥¹¥Ê¤òÀßÄꤹ¤ë¡£
+     *
+     * ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê
+     *
+     * - SET_FSM_STRUCTURE: FSM¹½Â¤¤ÎÀßÄê
+     * - GET_FSM_STRUCTURE: FSM¹½Â¤¤Î¼èÆÀ
+     *
+     * ¥ê¥¹¥Ê¤Ï FsmStructureListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä
+     * operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
+     *
+     * FsmStructureListener::operator()(FsmStructure& structure)
+     *
+     * ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï
+     * RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢
+     * removeFsmStructureListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£
+     * ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú
+     * ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+     *
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     * @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥°
+     *
+     * @else
+     * @brief Adding FsmStructure type listener
+     *
+     * This operation adds certain listeners related to FSM structure
+     * data which are handled by ExtendedFsmService.
+     *
+     * The following listener types are available.
+     *
+     * - SET_FSM_STRUCTURE: Setting FSM structure
+     * - GET_FSM_STRUCTURE: Getting FSM structure
+     *
+     * Listeners should have the following function operator().
+     *
+     * FsmStructureListener::operator()(RTC::FsmStructure structure)
+     *
+     * The ownership of the given listener object is transferred to
+     * this RTObject object in default.  The given listener object will
+     * be destroied automatically in the RTObject's dtor or if the
+     * listener is deleted by removeFsmStructureListener() function.
+     * If you want to keep ownership of the listener object, give
+     * "false" value to 3rd argument to inhibit automatic destruction.
+     *
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     * @param autoclean A flag for automatic listener destruction
+     *
+     * @endif
+     */
+    void
+    addFsmStructureListener(FsmStructureListenerType listener_type,
+                            FsmStructureListener* listener,
+                            bool autoclean = true);
+
+    template <class Listener>
+    FsmStructureListener*
+    addFsmStructureListener(FsmStructureListenerType listener_type,
+                            Listener& obj,
+                            void (Listener::*memfunc)(const RTC::PortProfile&))
+    {
+      class Noname
+        : public FsmStructureListener
+      {
+      public:
+        Noname(Listener& obj,
+               void (Listener::*memfunc)(const RTC::FsmStructure&))
+          : m_obj(obj), m_memfunc(memfunc)
+        {
+        }
+        void operator()(const RTC::PortProfile& pprofile)
+        {
+          (m_obj.*m_memfunc)(pprofile);
+        }
+      private:
+        Listener& m_obj;
+        typedef void (Listener::*Memfunc)(const RTC::FsmStructure&);
+        Memfunc m_memfunc;
+      };
+      Noname* listener(new Noname(obj, memfunc));
+      addFsmStructureListener(listener_type, listener, true);
+      return listener;
+    }
+
+    /*!
+     * @if jp
+     * @brief FsmStructureListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë
+     *
+     * ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
+     *
+     * @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥×
+     * @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿
+     *
+     * @else
+     * @brief Removing FsmStructure type listener
+     *
+     * This operation removes a specified listener.
+     *
+     * @param listener_type A listener type
+     * @param listener A pointer to a listener object
+     *
+     * @endif
+     */
+    void
+    removeFsmStructureListener(FsmStructureListenerType listener_type,
+                               FsmStructureListener* listener);
+
+
+
   protected:
     /*!
      * @if jp
@@ -4529,22 +5033,27 @@
     {
       m_actionListeners.portaction_[ADD_PORT].notify(pprof);
     }
-    
+
     inline void onRemovePort(const PortProfile& pprof)
     {
       m_actionListeners.portaction_[REMOVE_PORT].notify(pprof);
     }
-    
+
     inline void onAttachExecutionContext(UniqueId ec_id)
     {
       m_actionListeners.ecaction_[EC_ATTACHED].notify(ec_id);
     }
-    
+
     inline void onDetachExecutionContext(UniqueId ec_id)
     {
       m_actionListeners.ecaction_[EC_DETACHED].notify(ec_id);
     }
 
+    inline void onFsmStateChanged(const char* state)
+    {
+      m_fsmActionListeners.preaction_[PRE_ON_STATE_CHANGE].notify(state);
+    }
+
     ReturnCode_t getInheritedECOptions(coil::Properties& default_opts);
 
     /*!
@@ -4890,6 +5399,21 @@
      */
     PortConnectListeners m_portconnListeners;
 
+    /*!
+     * @if jp
+     * @brief ComponentActionListener¥Û¥ë¥À
+     *
+     * ComponentActionListenr¤òÊÝ»ý¤¹¤ë¥Û¥ë¥À
+     *
+     * @else
+     * @brief ComponentActionListener holder
+     *
+     * Holders of ComponentActionListeners
+     *
+     * @endif
+     */
+    FsmActionListeners m_fsmActionListeners;
+
     //------------------------------------------------------------
     // Functor
     //------------------------------------------------------------

Modified: trunk/OpenRTM-aist/win32/OpenRTM-aist/examples/Fsm/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/win32/OpenRTM-aist/examples/Fsm/Makefile.am	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/win32/OpenRTM-aist/examples/Fsm/Makefile.am	2017-12-10 21:18:08 UTC (rev 3115)
@@ -6,19 +6,16 @@
 ##---------------------------------------------------------------------------
 clean-local:
 	rm -rf Debug Release
-	rm -rf *~ *.cpp *.h *.idl rtc.conf
+	rm -rf *~ *.cc *.cpp *.h *.idl *.conf 
 	rm -rf *.vcproj *.vcxproj *.user *.ncb *.suo
 	rm -rf FsmComp
 
 src:
-	cp -p $(top_srcdir)/examples/Fsm/*.cpp .
 	cp -p $(top_srcdir)/examples/Fsm/*.cc .
 	cp -p $(top_srcdir)/examples/Fsm/*.h .
-	cp -p $(top_srcdir)/examples/Fsm/*.hpp .
-	cp -p $(top_srcdir)/examples/Fsm/rtc.conf .
-	qkc -O- -ms *.cpp
+	cp -p $(top_srcdir)/examples/Fsm/CMakeLists.txt .
+	cp -p $(top_srcdir)/examples/Fsm/*.conf .
 	qkc -O- -ms *.cc
 	qkc -O- -ms *.h
-	qkc -O- -ms *.hpp
 
 dist-hook: src

Modified: trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/Makefile.am	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/Makefile.am	2017-12-10 21:18:08 UTC (rev 3115)
@@ -8,7 +8,7 @@
 
 clean-local:
 	rm -rf Debug Release
-	rm -f *~ *.cpp *.h *.cc *.hh version.txt
+	rm -f *~ *.cpp *.h *.cc *.hh
 	rm -f *.sln *.suo *.ncb *.user *.vcproj *.vcxproj *.def
 
 src:

Modified: trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/idls/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/idls/Makefile.am	2017-12-10 21:16:07 UTC (rev 3114)
+++ trunk/OpenRTM-aist/win32/OpenRTM-aist/hrtm/idls/Makefile.am	2017-12-10 21:18:08 UTC (rev 3115)
@@ -11,9 +11,7 @@
 	rm -f *.sln *.suo *.ncb *.user *.vcproj *.vcxproj *.def
 
 src:
-	cp -p $(top_srcdir)/src/lib/hrtm/idls/*.cpp .
 	cp -p $(top_srcdir)/src/lib/hrtm/idls/*.h .
-	qkc -O- -ms *.cpp
 	qkc -O- -ms *.h
 
 dist-hook: src



More information about the openrtm-commit mailing list