[openrtm-commit:03115] r3190 - branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 1月 23日 (火) 16:58:05 JST


Author: miyamoto
Date: 2018-01-23 16:58:05 +0900 (Tue, 23 Jan 2018)
New Revision: 3190

Added:
   branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.cpp
   branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.h
   branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.cpp
   branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.h
Modified:
   branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Makefile.am
Log:
[compat, ->RELENG_1_2] refs #4428

Modified: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Makefile.am
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Makefile.am	2018-01-23 07:55:15 UTC (rev 3189)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/Makefile.am	2018-01-23 07:58:05 UTC (rev 3190)
@@ -121,10 +121,12 @@
 	InPortCorbaCdrConsumer.cpp   \
 	InPortDirectProvider.cpp     \
 	InPortDirectConsumer.cpp     \
-	InPortSHMConsumer.cpp     \
-	InPortSHMProvider.cpp     \
-	OutPortSHMConsumer.cpp     \
-	OutPortSHMProvider.cpp     \
+	InPortSHMConsumer.cpp        \
+	InPortSHMProvider.cpp        \
+	OutPortSHMConsumer.cpp       \
+	OutPortSHMProvider.cpp       \
+	OutPortDirectConsumer.cpp    \
+	OutPortDirectProvider.cpp    \
 	SharedMemoryPort.cpp
 
 

Added: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.cpp	                        (rev 0)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.cpp	2018-01-23 07:58:05 UTC (rev 3190)
@@ -0,0 +1,145 @@
+// -*- C++ -*-
+/*!
+ * @file  OutPortDirectConsumer.cpp
+ * @brief OutPortDirectConsumer class
+ * @date  $Date: 2018-01-17 07:52:40 $
+ * @author Nobuhiko Miyamoto <n-miyamoto at aist.go.jp>
+ *
+ * Copyright (C) 2018
+ *     Nobuhiko Miyamoto
+ *     Robot Innovation Research Center,
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ *
+ */
+
+#include <rtm/OutPortDirectConsumer.h>
+#include <rtm/NVUtil.h>
+
+namespace RTC
+{
+  /*!
+   * @if jp
+   * @brief コンストラクタ
+   * @else
+   * @brief Constructor
+   * @endif
+   */
+  OutPortDirectConsumer::OutPortDirectConsumer()
+  {
+    rtclog.setName("OutPortDirectConsumer");
+  }
+    
+  /*!
+   * @if jp
+   * @brief デストラクタ
+   * @else
+   * @brief Destructor
+   * @endif
+   */
+  OutPortDirectConsumer::~OutPortDirectConsumer(void)
+  {
+  } 
+
+  /*!
+   * @if jp
+   * @brief 設定初期化
+   * @else
+   * @brief Initializing configuration
+   * @endif
+   */
+  void OutPortDirectConsumer::init(coil::Properties& prop)
+  {
+    RTC_TRACE(("OutPortDirectConsumer::init()"));
+  }
+
+  /*!
+   * @if jp
+   * @brief バッファをセットする
+   * @else
+   * @brief Setting outside buffer's pointer
+   * @endif
+   */
+  void OutPortDirectConsumer::setBuffer(CdrBufferBase* buffer)
+  {
+    RTC_TRACE(("OutPortDirectConsumer::setBuffer()"));
+  }
+
+  /*!
+   * @if jp
+   * @brief リスナを設定する。
+   * @else
+   * @brief Set the listener. 
+   * @endif
+   */
+  void OutPortDirectConsumer::setListener(ConnectorInfo& info,
+                                            ConnectorListeners* listeners)
+  {
+    RTC_TRACE(("OutPortDirectConsumer::setListener()"));
+  }
+
+  /*!
+   * @if jp
+   * @brief データを読み出す
+   * @else
+   * @brief Read data
+   * @endif
+   */
+  OutPortConsumer::ReturnCode
+  OutPortDirectConsumer::get(cdrMemoryStream& data)
+  {
+    RTC_PARANOID(("get(): never called."));
+    return UNKNOWN_ERROR;
+  }
+    
+  /*!
+   * @if jp
+   * @brief データ受信通知への登録
+   * @else
+   * @brief Subscribe the data receive notification
+   * @endif
+   */
+  bool OutPortDirectConsumer::
+  subscribeInterface(const SDOPackage::NVList& properties)
+  {
+    RTC_TRACE(("subscribeInterface(): do nothing"));
+    return true;
+  }
+  
+  /*!
+   * @if jp
+   * @brief データ受信通知からの登録解除
+   * @else
+   * @brief Unsubscribe the data receive notification
+   * @endif
+   */
+  void OutPortDirectConsumer::
+  unsubscribeInterface(const SDOPackage::NVList& properties)
+  {
+  }
+
+
+};     // namespace RTC
+
+extern "C"
+{
+  /*!
+   * @if jp
+   * @brief モジュール初期化関数
+   * @else
+   * @brief Module initialization
+   * @endif
+   */
+  void OutPortDirectConsumerInit(void)
+  {
+    RTC::OutPortConsumerFactory&
+      factory(RTC::OutPortConsumerFactory::instance());
+    factory.addFactory("direct",
+                       ::coil::Creator< ::RTC::OutPortConsumer,
+                                        ::RTC::OutPortDirectConsumer>,
+                       ::coil::Destructor< ::RTC::OutPortConsumer,
+                                           ::RTC::OutPortDirectConsumer>);
+  }
+};

Added: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.h
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.h	                        (rev 0)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectConsumer.h	2018-01-23 07:58:05 UTC (rev 3190)
@@ -0,0 +1,284 @@
+// -*- C++ -*-
+/*!
+ * @file  InPortDirectConsumer.cpp
+ * @brief InPortDirectConsumer class
+ * @date  $Date: 2008-01-14 07:49:59 $
+ * @author Noriaki Ando <n-ando at aist.go.jp>
+ *
+ * Copyright (C) 2009-2010
+ *     Noriaki Ando
+ *     Task-intelligence Research Group,
+ *     Intelligent Systems Research Institute,
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ * $Id: InPortDirectConsumer.cpp 1244 2009-03-13 07:25:42Z n-ando $
+ *
+ */
+
+#ifndef RTC_OUTPORTDIRECTCONSUMER_H
+#define RTC_OUTPORTDIRECTCONSUMER_H
+
+
+#include <rtm/Manager.h>
+#include <rtm/OutPortConsumer.h>
+#include <rtm/ConnectorListener.h>
+#include <rtm/ConnectorBase.h>
+
+namespace RTC
+{
+  /*!
+   * @if jp
+   * @class OutPortDirectConsumer
+   * @brief OutPortDirectConsumer クラス
+   *
+   * OutPortConsumer 
+   *
+   * データ転送に CORBA の OpenRTM::OutPortCdr インターフェースを利用し
+   * た、pull 型データフロー型を実現する OutPort コンシューマクラス。
+   *
+   * @since 1.2.0
+   *
+   * @else
+   * @class OutPortDirectConsumer
+   * @brief OutPortDirectConsumer class
+   *
+   * The OutPort consumer class which uses the OpenRTM::OutPortCdr
+   * interface in CORBA for data transfer and realizes a pull-type
+   * dataflow.
+   *
+   * @since 1.2.0
+   *
+   * @endif
+   */
+	class OutPortDirectConsumer
+    : public OutPortConsumer
+  {
+  public:
+    DATAPORTSTATUS_ENUM
+
+    /*!
+     * @if jp
+     * @brief コンストラクタ
+     *
+     * コンストラクタ
+     *
+     * @else
+     * @brief Constructor
+     *
+     * Constructor
+     *
+     * @endif
+     */
+	 OutPortDirectConsumer();
+
+    /*!
+     * @if jp
+     * @brief デストラクタ
+     *
+     * デストラクタ
+     *
+     * @else
+     * @brief Destructor
+     *
+     * Destructor
+     *
+     * @endif
+     */
+	virtual ~OutPortDirectConsumer(void);
+
+    /*!
+     * @if jp
+     * @brief 設定初期化
+     *
+     * OutPortConsumerの各種設定を行う。実装クラスでは、与えられた
+     * Propertiesから必要な情報を取得して各種設定を行う。この init() 関
+     * 数は、OutPortProvider生成直後および、接続時にそれぞれ呼ばれる可
+     * 能性がある。したがって、この関数は複数回呼ばれることを想定して記
+     * 述されるべきである。
+     * 
+     * @param prop 設定情報
+     *
+     * @else
+     *
+     * @brief Initializing configuration
+     *
+     * This operation would be called to configure in initialization.
+     * In the concrete class, configuration should be performed
+     * getting appropriate information from the given Properties data.
+     * This function might be called right after instantiation and
+     * connection sequence respectivly.  Therefore, this function
+     * should be implemented assuming multiple call.
+     *
+     * @param prop Configuration information
+     *
+     * @endif
+     */
+    virtual void init(coil::Properties& prop);
+
+    /*!
+     * @if jp
+     * @brief バッファをセットする
+     *
+     * OutPortConsumerがデータを取り出すバッファをセットする。
+     * すでにセットされたバッファがある場合、以前のバッファへの
+     * ポインタに対して上書きされる。
+     * OutPortProviderはバッファの所有権を仮定していないので、
+     * バッファの削除はユーザの責任で行わなければならない。
+     *
+     * @param buffer OutPortProviderがデータを取り出すバッファへのポインタ
+     *
+     * @else
+     * @brief Setting outside buffer's pointer
+     *
+     * A pointer to a buffer from which OutPortProvider retrieve data.
+     * If already buffer is set, previous buffer's pointer will be
+     * overwritten by the given pointer to a buffer.  Since
+     * OutPortProvider does not assume ownership of the buffer
+     * pointer, destructor of the buffer should be done by user.
+     * 
+     * @param buffer A pointer to a data buffer to be used by OutPortProvider
+     *
+     * @endif
+     */
+    virtual void setBuffer(CdrBufferBase* buffer);
+
+    /*!
+     * @if jp
+     * @brief リスナを設定する。
+     *
+     * InPort はデータ送信処理における各種イベントに対して特定のリスナ
+     * オブジェクトをコールするコールバック機構を提供する。詳細は
+     * ConnectorListener.h の ConnectorDataListener, ConnectorListener
+     * 等を参照のこと。OutPortCorbaCdrProvider では、以下のコールバック
+     * が提供される。
+     * 
+     * - ON_BUFFER_WRITE
+     * - ON_BUFFER_FULL
+     * - ON_RECEIVED
+     * - ON_RECEIVER_FULL 
+     * - ON_SENDER_EMPTY
+     * - ON_SENDER_TIMEOUT
+     * - ON_SENDER_ERROR
+     *
+     * @param info 接続情報
+     * @param listeners リスナオブジェクト
+     *
+     * @else
+     * @brief Set the listener. 
+     *
+     * OutPort provides callback functionality that calls specific
+     * listener objects according to the events in the data publishing
+     * process. For details, see documentation of
+     * ConnectorDataListener class and ConnectorListener class in
+     * ConnectorListener.h. In this OutPortCorbaCdrProvider provides
+     * the following callbacks.
+     * 
+     * - ON_BUFFER_WRITE
+     * - ON_BUFFER_FULL
+     * - ON_RECEIVED
+     * - ON_RECEIVER_FULL 
+     * - ON_SENDER_EMPTY
+     * - ON_SENDER_TIMEOUT
+     * - ON_SENDER_ERROR
+     *
+     * @param info Connector information
+     * @param listeners Listener objects
+     *
+     * @endif
+     */
+    virtual void setListener(ConnectorInfo& info,
+                             ConnectorListeners* listeners);
+
+    /*!
+     * @if jp
+     * @brief データを読み出す
+     *
+     * 設定されたデータを読み出す。
+     *
+     * @param data 読み出したデータを受け取るオブジェクト
+     *
+     * @return データ読み出し処理結果(読み出し成功:true、読み出し失敗:false)
+     *
+     * @else
+     * @brief Read data
+     *
+     * Read set data
+     *
+     * @param data Object to receive the read data
+     *
+     * @return Read result (Successful:true, Failed:false)
+     *
+     * @endif
+     */
+    virtual ReturnCode get(cdrMemoryStream& data);
+
+    /*!
+     * @if jp
+     * @brief データ受信通知への登録
+     *
+     * 指定されたプロパティに基づいて、データ受信通知の受け取りに登録する。
+     *
+     * @param properties 登録情報
+     *
+     * @return 登録処理結果(登録成功:true、登録失敗:false)
+     *
+     * @else
+     * @brief Subscribe the data receive notification
+     *
+     * Subscribe the data receive notification based on specified property
+     * information
+     *
+     * @param properties Subscription information
+     *
+     * @return Subscription result (Successful:true, Failed:false)
+     *
+     * @endif
+     */
+    virtual bool subscribeInterface(const SDOPackage::NVList& properties);
+    
+    /*!
+     * @if jp
+     * @brief データ受信通知からの登録解除
+     *
+     * データ受信通知の受け取りから登録を解除する。
+     *
+     * @param properties 登録解除情報
+     *
+     * @else
+     * @brief Unsubscribe the data receive notification
+     *
+     * Unsubscribe the data receive notification.
+     *
+     * @param properties Unsubscription information
+     *
+     * @endif
+     */
+    virtual void unsubscribeInterface(const SDOPackage::NVList& properties);
+    
+private:
+	mutable Logger rtclog;
+	coil::Properties m_properties;
+  };
+};     // namespace RTC
+
+extern "C"
+{
+  /*!
+   * @if jp
+   * @brief モジュール初期化関数
+   *
+   * OutPortDirectConsumer のファクトリを登録する初期化関数。
+   *
+   * @else
+   * @brief Module initialization
+   *
+   * This initialization function registers OutPortDirectConsumer's factory.
+   *
+   * @endif
+   */
+	void OutPortDirectConsumerInit(void);
+};
+
+#endif // RTC_OUTPORTDIRECTCONSUMER_H

Added: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.cpp
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.cpp	                        (rev 0)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.cpp	2018-01-23 07:58:05 UTC (rev 3190)
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+/*!
+ * @file  OutPortDirectProvider.cpp
+ * @brief OutPortDirectProvider class
+ * @date  $Date: 2018-01-17 07:52:40 $
+ * @author Nobuhiko Miyamoto <n-miyamoto at aist.go.jp>
+ *
+ * Copyright (C) 2018
+ *     Nobuhiko Miyamoto
+ *     Robot Innovation Research Center,
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ *
+ */
+
+#include <rtm/OutPortDirectProvider.h>
+
+#ifdef WIN32
+#pragma warning( disable : 4290 )
+#endif
+
+namespace RTC
+{
+  /*!
+   * @if jp
+   * @brief コンストラクタ
+   * @else
+   * @brief Constructor
+   * @endif
+   */
+  OutPortDirectProvider::OutPortDirectProvider(void)
+   : m_buffer(0) 
+  {
+    // PortProfile setting
+    setInterfaceType("direct");
+
+  }
+  
+  /*!
+   * @if jp
+   * @brief デストラクタ
+   * @else
+   * @brief Destructor
+   * @endif
+   */
+  OutPortDirectProvider::~OutPortDirectProvider(void)
+  {
+
+  }
+  
+  /*!
+   * @if jp
+   * @brief 設定初期化
+   * @else
+   * @brief Initializing configuration
+   * @endif
+   */
+  void OutPortDirectProvider::init(coil::Properties& prop)
+  {
+  }
+
+  /*!
+   * @if jp
+   * @brief バッファをセットする
+   * @else
+   * @brief Setting outside buffer's pointer
+   * @endif
+   */
+  void OutPortDirectProvider::setBuffer(CdrBufferBase* buffer)
+  {
+    m_buffer = buffer;
+  }
+
+  /*!
+   * @if jp
+   * @brief リスナを設定する。
+   * @else
+   * @brief Set the listener. 
+   * @endif
+   */
+  void OutPortDirectProvider::setListener(ConnectorInfo& info,
+                                            ConnectorListeners* listeners)
+  {
+    m_profile = info;
+    m_listeners = listeners;
+  }
+
+  /*!
+   * @if jp
+   * @brief コネクタをセットする
+   * @else
+   * @brief Setting outside connector's pointer
+   * @endif
+   */
+  void OutPortDirectProvider::setConnector(OutPortConnector* connector)
+  {
+    m_connector = connector;
+  }
+
+};     // namespace RTC
+
+extern "C"
+{
+  /*!
+   * @if jp
+   * @brief モジュール初期化関数
+   * @else
+   * @brief Module initialization
+   * @endif
+   */
+  void OutPortDirectProviderInit(void)
+  {
+    RTC::OutPortProviderFactory&
+      factory(RTC::OutPortProviderFactory::instance());
+    factory.addFactory("direct",
+                       ::coil::Creator< ::RTC::OutPortProvider,
+                                        ::RTC::OutPortDirectProvider>,
+                       ::coil::Destructor< ::RTC::OutPortProvider,
+                                           ::RTC::OutPortDirectProvider>);
+  }
+};

Added: branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.h
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.h	                        (rev 0)
+++ branches/RELENG_1_2/OpenRTM-aist/src/lib/rtm/OutPortDirectProvider.h	2018-01-23 07:58:05 UTC (rev 3190)
@@ -0,0 +1,348 @@
+// -*- C++ -*-
+/*!
+ * @file  OutPortDirectProvider.h
+ * @brief OutPortDirectProvider class
+ * @date  $Date: 2018-01-17 07:52:40 $
+ * @author Nobuhiko Miyamoto <n-miyamoto at aist.go.jp>
+ *
+ * Copyright (C) 2018
+ *     Nobuhiko Miyamoto
+ *     Robot Innovation Research Center,
+ *     National Institute of
+ *         Advanced Industrial Science and Technology (AIST), Japan
+ *     All rights reserved.
+ *
+ *
+ */
+
+#ifndef RTC_OUTPORTDIRECTPROVIDER_H
+#define RTC_OUTPORTDIRECTPROVIDER_H
+
+
+#include <rtm/BufferBase.h>
+#include <rtm/OutPortProvider.h>
+#include <rtm/Manager.h>
+#include <rtm/ConnectorListener.h>
+#include <rtm/ConnectorBase.h>
+
+#ifdef WIN32
+#pragma warning( disable : 4290 )
+#endif
+
+namespace RTC
+{
+  /*!
+   * @if jp
+   * @class OutPortDirectProvider
+   * @brief OutPortDirectProvider クラス
+   *
+   * OutPortProvider 
+   *
+   * 
+   * 
+   *
+   * @since 1.2.0
+   *
+   * @else
+   * @class OutPortDirectProvider
+   * @brief OutPortDirectProvider class
+   *
+   *
+   * @since 1.2.0
+   *
+   * @endif
+   */
+  class OutPortDirectProvider
+    : public OutPortProvider
+  {
+  public:
+    /*!
+     * @if jp
+     * @brief コンストラクタ
+     *
+     * コンストラクタ
+     *
+     * @else
+     * @brief Constructor
+     *
+     * Constructor
+     *
+     * @endif
+     */
+    OutPortDirectProvider(void);
+
+    /*!
+     * @if jp
+     * @brief デストラクタ
+     *
+     * デストラクタ
+     *
+     * @else
+     * @brief Destructor
+     *
+     * Destructor
+     *
+     * @endif
+     */
+    virtual ~OutPortDirectProvider(void);
+
+    /*!
+     * @if jp
+     * @brief 設定初期化
+     *
+     * OutPortDirectProvider の各種設定を行う。与えられた
+     * Propertiesから必要な情報を取得して各種設定を行う。この init() 関
+     * 数は、OutPortProvider生成直後および、接続時にそれぞれ呼ばれる可
+     * 能性がある。したがって、この関数は複数回呼ばれることを想定して記
+     * 述されるべきである。
+     * 
+     * @param prop 設定情報
+     *
+     * @else
+     *
+     * @brief Initializing configuration
+     *
+     * This operation would be called to configure in initialization.
+     * In the concrete class, configuration should be performed
+     * getting appropriate information from the given Properties data.
+     * This function might be called right after instantiation and
+     * connection sequence respectivly.  Therefore, this function
+     * should be implemented assuming multiple call.
+     *
+     * @param prop Configuration information
+     *
+     * @endif
+     */
+    virtual void init(coil::Properties& prop);
+
+    /*!
+     * @if jp
+     * @brief バッファをセットする
+     *
+     * OutPortProvider がデータを取り出すバッファをセットする。
+     * すでにセットされたバッファがある場合、以前のバッファへの
+     * ポインタに対して上書きされる。
+     * OutPortProviderはバッファの所有権を仮定していないので、
+     * バッファの削除はユーザの責任で行わなければならない。
+     *
+     * @param buffer OutPortProviderがデータを取り出すバッファへのポインタ
+     *
+     * @else
+     * @brief Setting outside buffer's pointer
+     *
+     * A pointer to a buffer from which OutPortProvider retrieve data.
+     * If already buffer is set, previous buffer's pointer will be
+     * overwritten by the given pointer to a buffer.  Since
+     * OutPortProvider does not assume ownership of the buffer
+     * pointer, destructor of the buffer should be done by user.
+     * 
+     * @param buffer A pointer to a data buffer to be used by OutPortProvider
+     *
+     * @endif
+     */
+    virtual void setBuffer(CdrBufferBase* buffer);
+
+    /*!
+     * @if jp
+     * @brief リスナを設定する。
+     *
+     * OutPort はデータ送信処理における各種イベントに対して特定のリスナ
+     * オブジェクトをコールするコールバック機構を提供する。詳細は
+     * ConnectorListener.h の ConnectorDataListener, ConnectorListener
+     * 等を参照のこと。OutPortDirectProvider では、以下のコールバック
+     * が提供される。
+     * 
+     * - ON_BUFFER_READ
+     * - ON_SEND
+     * - ON_BUFFER_EMPTY
+     * - ON_BUFFER_READ_TIMEOUT
+     * - ON_SENDER_EMPTY
+     * - ON_SENDER_TIMEOUT
+     * - ON_SENDER_ERROR
+     *
+     * @param info 接続情報
+     * @param listeners リスナオブジェクト
+     *
+     * @else
+     * @brief Set the listener. 
+     *
+     * OutPort provides callback functionality that calls specific
+     * listener objects according to the events in the data publishing
+     * process. For details, see documentation of
+     * ConnectorDataListener class and ConnectorListener class in
+     * ConnectorListener.h. In this OutPortDirectProvider provides
+     * the following callbacks.
+     * 
+     * - ON_BUFFER_READ
+     * - ON_SEND
+     * - ON_BUFFER_EMPTY
+     * - ON_BUFFER_READ_TIMEOUT
+     * - ON_SENDER_EMPTY
+     * - ON_SENDER_TIMEOUT
+     * - ON_SENDER_ERROR
+     *
+     * @param info Connector information
+     * @param listeners Listener objects
+     *
+     * @endif
+     */
+    virtual void setListener(ConnectorInfo& info,
+                             ConnectorListeners* listeners);
+
+    /*!
+     * @if jp
+     * @brief Connectorを設定する。
+     *
+     * OutPort は接続確立時に OutPortConnector オブジェクトを生成し、生
+     * 成したオブジェクトのポインタと共にこの関数を呼び出す。所有権は
+     * OutPort が保持するので OutPortProvider は OutPortConnector を削
+     * 除してはいけない。
+     *
+     * @param connector OutPortConnector
+     *
+     * @else
+     * @brief set Connector
+     *
+     * OutPort creates OutPortConnector object when it establishes
+     * connection between OutPort and InPort, and it calls this
+     * function with a pointer to the connector object. Since the
+     * OutPort has the ownership of this connector, OutPortProvider
+     * should not delete it.
+     *
+     * @param connector OutPortConnector
+     *
+     * @endif
+     */
+    virtual void setConnector(OutPortConnector* connector);
+
+    
+  private:
+
+
+
+    /*!
+     * @if jp
+     * @brief ON_BUFFER_READ のリスナへ通知する。 
+     * @param data cdrMemoryStream
+     * @else
+     * @brief Notify an ON_BUFFER_READ event to listeners
+     * @param data cdrMemoryStream
+     * @endif
+     */
+    inline void onBufferRead(const cdrMemoryStream& data)
+    {
+      m_listeners->
+        connectorData_[ON_BUFFER_READ].notify(m_profile, data);
+    }
+
+    /*!
+     * @if jp
+     * @brief ON_SEND のリスナへ通知する。 
+     * @param data cdrMemoryStream
+     * @else
+     * @brief Notify an ON_SEND event to listeners
+     * @param data cdrMemoryStream
+     * @endif
+     */
+    inline void onSend(const cdrMemoryStream& data)
+    {
+      m_listeners->
+        connectorData_[ON_SEND].notify(m_profile, data);
+    }
+
+    /*!
+     * @if jp
+     * @brief ON_BUFFER_EMPTYのリスナへ通知する。 
+     * @else
+     * @brief Notify an ON_BUFFER_EMPTY event to listeners
+     * @endif
+     */
+    inline void onBufferEmpty()
+    {
+      m_listeners->
+        connector_[ON_BUFFER_EMPTY].notify(m_profile);
+    }
+
+    /*!
+     * @if jp
+     * @brief ON_BUFFER_READ_TIMEOUT のリスナへ通知する。 
+     * @else
+     * @brief Notify an ON_BUFFER_READ_TIMEOUT event to listeners
+     * @endif
+     */
+    inline void onBufferReadTimeout()
+    {
+      m_listeners->
+        connector_[ON_BUFFER_READ_TIMEOUT].notify(m_profile);
+    }
+
+    /*!
+     * @if jp
+     * @brief ON_SENDER_EMPTYのリスナへ通知する。 
+     * @else
+     * @brief Notify an ON_SENDER_EMPTY event to listeners
+     * @endif
+     */
+    inline void onSenderEmpty()
+    {
+      m_listeners->
+        connector_[ON_SENDER_EMPTY].notify(m_profile);
+    }
+
+    /*!
+     * @if jp
+     * @brief ON_SENDER_TIMEOUT のリスナへ通知する。 
+     * @else
+     * @brief Notify an ON_SENDER_TIMEOUT event to listeners
+     * @endif
+     */
+    inline void onSenderTimeout()
+    {
+      m_listeners->
+        connector_[ON_SENDER_TIMEOUT].notify(m_profile);
+    }
+
+    /*!
+     * @if jp
+     * @brief ON_SENDER_ERRORのリスナへ通知する。 
+     * @else
+     * @brief Notify an ON_SENDER_ERROR event to listeners
+     * @endif
+     */
+    inline void onSenderError()
+    {
+      m_listeners->
+        connector_[ON_SENDER_ERROR].notify(m_profile);
+    }
+    
+  private:
+    CdrBufferBase* m_buffer;
+    ConnectorListeners* m_listeners;
+    ConnectorInfo m_profile;
+    OutPortConnector* m_connector;
+  };  // class OutPortDirectProvider
+};     // namespace RTC
+
+extern "C"
+{
+  /*!
+   * @if jp
+   * @brief モジュール初期化関数
+   *
+   * OutPortDirectProvider のファクトリを登録する初期化関数。
+   *
+   * @else
+   * @brief Module initialization
+   *
+   * This initialization function registers OutPortDirectProvider's factory.
+   *
+   * @endif
+   */
+  void OutPortDirectProviderInit(void);
+};
+
+#ifdef WIN32
+#pragma warning( default : 4290 )
+#endif
+
+#endif // RTC_OUTPORTDIRECTPROVIDER_H



More information about the openrtm-commit mailing list