[openrtm-commit:02983] r3117 - in trunk/OpenRTM-aist: examples/SimpleIO src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 12月 11日 (月) 07:41:30 JST
Author: n-ando
Date: 2017-12-11 07:41:30 +0900 (Mon, 11 Dec 2017)
New Revision: 3117
Added:
trunk/OpenRTM-aist/src/lib/rtm/Timestamp.h
Modified:
trunk/OpenRTM-aist/examples/SimpleIO/ConsoleIn.h
trunk/OpenRTM-aist/examples/SimpleIO/ConsoleOut.h
trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.cpp
trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
trunk/OpenRTM-aist/src/lib/rtm/InPort.h
trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.h
trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/InPortDirectProvider.h
trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.h
trunk/OpenRTM-aist/src/lib/rtm/Makefile.am
trunk/OpenRTM-aist/src/lib/rtm/OutPort.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.h
trunk/OpenRTM-aist/src/lib/rtm/PublisherBase.h
trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp
trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.h
trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp
trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.h
trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.cpp
trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.h
Log:
merged changes from branches/FSM4RTC/OpenRTM-aist r2877-2880. TODO: confliction resolution makes some files character code inconsistency:
[FSM4RTC,incompat,->RELENG_1_2,->RELENG_2_0] Connector listeners intarfaces have been changed to modify info and data in the listeners and return its status. refs #3871
[FSM4RTC,incompat,->RELENG_1_2,->RELENG_2_0] Some callback points have been added. refs #3871
[FSM4RTC,incomapt,->RELENG_1_2,->RELENG_2_0] Timestamp class template has been added. Timestamp listeners have been added to InPort and OutPort. refs #3871
[FSM4RTC,incompat,->RELENG_1_2,->RELENG_2_0] ConnectorListener, ConnectorDataListener interfaces have been changed. refs #3871
Modified: trunk/OpenRTM-aist/examples/SimpleIO/ConsoleIn.h
===================================================================
--- trunk/OpenRTM-aist/examples/SimpleIO/ConsoleIn.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/examples/SimpleIO/ConsoleIn.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -35,6 +35,7 @@
class DataListener
: public ConnectorDataListenerT<RTC::TimedLong>
{
+ USE_CONNLISTENER_STATUS;
public:
DataListener(const char* name) : m_name(name) {}
virtual ~DataListener()
@@ -42,8 +43,8 @@
std::cout << "dtor of " << m_name << std::endl;
}
- virtual void operator()(const ConnectorInfo& info,
- const TimedLong& data)
+ virtual ReturnCode operator()(ConnectorInfo& info,
+ TimedLong& data)
{
std::cout << "------------------------------" << std::endl;
std::cout << "Data Listener: " << m_name << std::endl;
@@ -54,6 +55,7 @@
// std::cout << std::endl;
std::cout << "Data: " << data.data << std::endl;
std::cout << "------------------------------" << std::endl;
+ return NO_CHANGE;
};
std::string m_name;
};
@@ -62,6 +64,7 @@
class ConnListener
: public ConnectorListener
{
+ USE_CONNLISTENER_STATUS;
public:
ConnListener(const char* name) : m_name(name) {}
virtual ~ConnListener()
@@ -69,7 +72,7 @@
std::cout << "dtor of " << m_name << std::endl;
}
- virtual void operator()(const ConnectorInfo& info)
+ virtual ReturnCode operator()(ConnectorInfo& info)
{
std::cout << "------------------------------" << std::endl;
std::cout << "Connector Listener: " << m_name << std::endl;
@@ -79,6 +82,7 @@
std::cout << info.properties;
std::cout << std::endl;
std::cout << "------------------------------" << std::endl;
+ return NO_CHANGE;
};
std::string m_name;
};
Modified: trunk/OpenRTM-aist/examples/SimpleIO/ConsoleOut.h
===================================================================
--- trunk/OpenRTM-aist/examples/SimpleIO/ConsoleOut.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/examples/SimpleIO/ConsoleOut.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -35,6 +35,7 @@
class DataListener
: public ConnectorDataListenerT<RTC::TimedLong>
{
+ USE_CONNLISTENER_STATUS;
public:
DataListener(const char* name) : m_name(name) {}
virtual ~DataListener()
@@ -42,8 +43,8 @@
std::cout << "dtor of " << m_name << std::endl;
}
- virtual void operator()(const ConnectorInfo& info,
- const TimedLong& data)
+ virtual ReturnCode operator()(ConnectorInfo& info,
+ TimedLong& data)
{
std::cout << "------------------------------" << std::endl;
std::cout << "Data Listener: " << m_name << std::endl;
@@ -54,6 +55,7 @@
// std::cout << std::endl;
std::cout << "Data: " << data.data << std::endl;
std::cout << "------------------------------" << std::endl;
+ return NO_CHANGE;
};
std::string m_name;
};
@@ -62,6 +64,7 @@
class ConnListener
: public ConnectorListener
{
+ USE_CONNLISTENER_STATUS;
public:
ConnListener(const char* name) : m_name(name) {}
virtual ~ConnListener()
@@ -69,7 +72,7 @@
std::cout << "dtor of " << m_name << std::endl;
}
- virtual void operator()(const ConnectorInfo& info)
+ virtual ReturnCode operator()(ConnectorInfo& info)
{
std::cout << "------------------------------" << std::endl;
std::cout << "Connector Listener: " << m_name << std::endl;
@@ -79,6 +82,7 @@
std::cout << info.properties;
std::cout << std::endl;
std::cout << "------------------------------" << std::endl;
+ return NO_CHANGE;
};
std::string m_name;
};
Modified: trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -21,6 +21,18 @@
namespace RTC
{
+ ConnectorListenerStatus::Enum operator|(ConnectorListenerStatus::Enum L,
+ ConnectorListenerStatus::Enum R)
+ {
+ return static_cast<ConnectorListenerStatus::Enum>(static_cast<uint64_t>(L) |
+ static_cast<uint64_t>(R));
+ }
+ ConnectorListenerStatus::Enum operator&(ConnectorListenerStatus::Enum L,
+ ConnectorListenerStatus::Enum R)
+ {
+ return static_cast<ConnectorListenerStatus::Enum>(static_cast<uint64_t>(L) &
+ static_cast<uint64_t>(R));
+ }
/*!
* @if jp
* @class ConnectorDataListener ¥¯¥é¥¹
@@ -98,14 +110,17 @@
return m_listeners.size();
}
- void ConnectorDataListenerHolder::notify(const ConnectorInfo& info,
- const cdrMemoryStream& cdrdata)
+ ConnectorDataListenerHolder::ReturnCode
+ ConnectorDataListenerHolder::notify(ConnectorInfo& info,
+ cdrMemoryStream& cdrdata)
{
Guard guard(m_mutex);
+ ConnectorListenerHolder::ReturnCode ret(NO_CHANGE);
for (int i(0), len(m_listeners.size()); i < len; ++i)
{
- m_listeners[i].first->operator()(info, cdrdata);
+ ret = ret | m_listeners[i].first->operator()(info, cdrdata);
}
+ return ret;
}
@@ -119,8 +134,8 @@
ConnectorListenerHolder::ConnectorListenerHolder()
{
}
-
-
+
+
ConnectorListenerHolder::~ConnectorListenerHolder()
{
Guard guard(m_mutex);
@@ -159,22 +174,24 @@
return;
}
}
-
}
-
+
size_t ConnectorListenerHolder::size()
{
Guard guard(m_mutex);
return m_listeners.size();
}
-
- void ConnectorListenerHolder::notify(const ConnectorInfo& info)
+
+ ConnectorListenerHolder::ReturnCode
+ ConnectorListenerHolder::notify(ConnectorInfo& info)
{
Guard guard(m_mutex);
+ ConnectorListenerHolder::ReturnCode ret;
for (int i(0), len(m_listeners.size()); i < len; ++i)
{
- m_listeners[i].first->operator()(info);
+ ret = ret | m_listeners[i].first->operator()(info);
}
+ return ret;
}
};
Modified: trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -5,10 +5,8 @@
* @date $Date$
* @author Noriaki Ando <n-ando at aist.go.jp>
*
- * Copyright (C) 2009
+ * Copyright (C) 2009-2017
* Noriaki Ando
- * Task-intelligence Research Group,
- * Intelligent Systems Research Institute,
* National Institute of
* Advanced Industrial Science and Technology (AIST), Japan
* All rights reserved.
@@ -32,25 +30,98 @@
namespace RTC
{
class ConnectorInfo;
+ /*!
+ * @if jp
+ * @class ConnectorListenerStatus mixin class
+ * @brief ConnectorListenerStatus mixin ¥¯¥é¥¹
+ *
+ * ¤³¤Î¥¯¥é¥¹¤Ï¡¢enumÄEÁ¤µ¤E¿¥E¿¡¼¥ó¥³¡¼¥É¤ò¡¢ConnectorListener´Ø
+ * Ï¢¤Î¥µ¥Ö¥¯¥é¥¹¤Ç¶¦ÄÌÍøÍѤ¹¤E¿¤á¤Î mixin ¥¯¥é¥¹¤Ç¤¢¤E£¤³¤Î¥E¿¡¼
+ * ¥ó¥³¡¼¥É¤ò»ÈÍѤ¹¤E¯¥é¥¹¤Ç¤Ï¡¢ConnectorListenerStatus ¥¯¥é¥¹¤E * public ·Ñ¾µ¤·¡¢²¼¤Ëdefine ¤·¤Æ¤¢¤ECONNLISTENER_STATUS_ENUM ¤ò¥¯¥E * ¥¹Æâ¤Ëµ½Ò¤¹¤E³¤È¤ÇÍøÍѲÄǽ¤È¤Ê¤E£¤³¤Eˤè¤ê¡¢enum ¤E * ReturnCode ·¿¤È¤·¤Æ typedef ¤·¡¢°Ê¸EReturnCode ¤òÍøÍѤǤ¤E褦¤Ë
+ * ¤¹¤EȤȤâ¤Ë¡¢Ì¾Á°¶õ´Ö¤Ë enum ÄEÁ¤µ¤E¿³Æ¼±Ê̻ҤòÅö³º¥¯¥é¥¹Ì¾Á°¶E * ´ÖÆâ¤ËƳÆþ¤¹¤E£
+ *
+ * @else
+ * @class DataPortStatus mixin class
+ * @brief DataPortStatus mixin class
+ *
+ * This is a mixin class to provide enumed return codes that are
+ * commonly utilised in connector listener related sub-classes. To
+ * use this class, sub-class should inherit this class as a public
+ * super class, and declare CONNLISTENERSTATUS_ENUM defined
+ * below. Consequently, ReturnCode type that is typedefed by this
+ * macro can be used in the sub-class, and enumed identifiers are
+ * imported to the class's namespace.
+ *
+ * @endif
+ */
+ class ConnectorListenerStatus
+ {
+ public:
+ enum Enum
+ {
+ NO_CHANGE = 0,
+ INFO_CHANGED = 1 << 0,
+ DATA_CHANGED = 1 << 1,
+ BOTH_CHANGED = INFO_CHANGED | DATA_CHANGED
+ };
+ };
+ ConnectorListenerStatus::Enum operator|(ConnectorListenerStatus::Enum L,
+ ConnectorListenerStatus::Enum R);
+ ConnectorListenerStatus::Enum operator&(ConnectorListenerStatus::Enum L,
+ ConnectorListenerStatus::Enum R);
/*!
* @if jp
+ *
+
+ /*!
+ * @if jp
+ * ¤¤¤Æ¡¢¥¯¥é¥¹ÀEÀ¤ÎÀèƬ¤Ë¤ª¤¤¤Æ DATAPORTSTATUS_ENUM ¤òµºÜ¤¹¤EÀ¤±¤Ç¡¢
+ * DataPortStatus ¤ÇÀEÀ¤µ¤EƤ¤¤Eenum ¥á¥ó¥Ð¤¬Ì¾Á°²ò·è±é»»»Ò¤Ê¤·¤Ë¥¢
+ * ¥¯¥»¥¹²Äǽ¤Ë¤Ê¤E£
+ *
+ * @else
+ *
+ * @brief Importing ::RTC::DataPortStatus macro
+ *
+ * This macro imports all the member of enum declared in
+ * ::RTC::DataPortStatus into the current namespace. Inserting at the
+ * head of class declaration, classes which utilize DataPortStatus can
+ * access Enum members of DataPortStatus without using namespace
+ * resolve operator.
+ *
+ * @endif
+ */
+#define USE_CONNLISTENER_STATUS \
+ typedef ::RTC::ConnectorListenerStatus::Enum ReturnCode; \
+ using ::RTC::ConnectorListenerStatus::NO_CHANGE; \
+ using ::RTC::ConnectorListenerStatus::INFO_CHANGED; \
+ using ::RTC::ConnectorListenerStatus::DATA_CHANGED; \
+ using ::RTC::ConnectorListenerStatus::BOTH_CHANGED;
+
+ /*!
+ * @if jp
* @brief ConnectorDataListener ¤Î¥¿¥¤¥×
*
* - ON_BUFFER_WRITE: ¥Ð¥Ã¥Õ¥¡½ñ¤¹þ¤ß»þ
- * - ON_BUFFER_FULL: ¥Ð¥Ã¥Õ¥¡¥Õ¥ë»þ
+ * - ON_BUFFER_FULL: ¥Ð¥Ã¥Õ¥¡¥Õ¥Eþ
* - ON_BUFFER_WRITE_TIMEOUT: ¥Ð¥Ã¥Õ¥¡½ñ¤¹þ¤ß¥¿¥¤¥à¥¢¥¦¥È»þ
+ * @brief ConnectorDataListener ¤Î¥¿¥¤¥×
+ *
+ * - ON_BUFFER_WRITE: ¥Ð¥Ã¥Õ¥¡½ñ¤¹þ¤ß»þ
+ * - ON_BUFFER_FULL: ¥Ð¥Ã¥Õ¥¡¥Õ¥Eþ
+ * - ON_BUFFER_WRITE_TIMEOUT: ¥Ð¥Ã¥Õ¥¡½ñ¤¹þ¤ß¥¿¥¤¥à¥¢¥¦¥È»þ
* - ON_BUFFER_OVERWRITE: ¥Ð¥Ã¥Õ¥¡¾å½ñ¤»þ
* - ON_BUFFER_READ: ¥Ð¥Ã¥Õ¥¡Æɤ߽Ф·»þ
* - ON_SEND: InProt¤Ø¤ÎÁ÷¿®»þ
* - ON_RECEIVED: InProt¤Ø¤ÎÁ÷¿®´°Î»»þ
- * - ON_RECEIVER_FULL: InProt¦¥Ð¥Ã¥Õ¥¡¥Õ¥ë»þ
+ * - ON_RECEIVER_FULL: InProt¦¥Ð¥Ã¥Õ¥¡¥Õ¥Eþ
* - ON_RECEIVER_TIMEOUT: InProt¦¥Ð¥Ã¥Õ¥¡¥¿¥¤¥à¥¢¥¦¥È»þ
* - ON_RECEIVER_ERROR: InProt¦¥¨¥é¡¼»þ
*
* @else
* @brief The types of ConnectorDataListener
- *
+ * - ON_BUFFER_READ: At the time of buffer read
* - ON_BUFFER_WRITE: At the time of buffer write
* - ON_BUFFER_FULL: At the time of buffer full
* - ON_BUFFER_WRITE_TIMEOUT: At the time of buffer write timeout
@@ -66,17 +137,17 @@
*/
enum ConnectorDataListenerType
{
- ON_BUFFER_WRITE = 0,
- ON_BUFFER_FULL,
- ON_BUFFER_WRITE_TIMEOUT,
- ON_BUFFER_OVERWRITE,
- ON_BUFFER_READ,
- ON_SEND,
+ ON_SEND,
ON_RECEIVED,
- ON_RECEIVER_FULL,
- ON_RECEIVER_TIMEOUT,
+ ON_RECEIVER_FULL,
+ ON_RECEIVER_TIMEOUT,
ON_RECEIVER_ERROR,
CONNECTOR_DATA_LISTENER_NUM
+ ON_RECEIVED,
+
+ /*!
+ ON_RECEIVER_ERROR,
+ CONNECTOR_DATA_LISTENER_NUM
};
/*!
@@ -84,38 +155,75 @@
* @class ConnectorDataListener ¥¯¥é¥¹
* @brief ConnectorDataListener ¥¯¥é¥¹
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥³¡¼
- * ¥ë¥Ð¥Ã¥¯¤ò¼Â¸½¤¹¤ë¥ê¥¹¥Ê¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¡£
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ËÂФ¹¤E³¡¼
+ * ¥EХ寤ò¼Â¸½¤¹¤EE¹¥Ê¥¯¥é¥¹¤Î´ðÄE¯¥é¥¹¡£
*
- * ¥³¥¢¥í¥¸¥Ã¥¯¤¬OutPort¤ËÂФ·¤Æ¥Ç¡¼¥¿½ñ¤¹þ¤ß¡¢InPort¦¤Ç¥Ç¡¼¥¿¤¬¼è
- * ÆÀ¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö¤ÇȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ò¥Õ¥Ã¥¯¤¹¤ë¥³¡¼¥ë¥Ð¥Ã¥¯¤òÀß
- * Äꤹ¤ë¤³¤È¤¬¤Ç¤¤ë¡£¤Ê¤ª¡¢¥ê¥¹¥Ê¡¼¥¯¥é¥¹¤Ï2¼ïÎฺߤ·¡¢¥Ð¥Ã¥Õ¥¡¥Õ
- * ¥ë¤äÁ÷¿®»þ¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¤Ç¡¢¤½¤Î»þÅÀ¤Ç͸ú¤Ê¥Ç¡¼¥¿¤ò¥Õ¥¡¥ó¥¯¥¿¤Î°ú
- * ¿ô¤È¤·¤Æ¼õ¤±¼è¤ë ConnectorDataListener ¤Ç¤¢¤ê¡¢¤â¤¦°ìÊý¤Ï¥Ç¡¼¥¿¥¨
+ * ¥³¥¢¥úÁ¸¥Ã¥¯¤¬OutPort¤ËÂФ·¤Æ¥Ç¡¼¥¿½ñ¤¹þ¤ß¡¢InPort¦¤Ç¥Ç¡¼¥¿¤¬¼E * ÆÀ¤µ¤EEޤǤδ֤ÇȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ò¥Õ¥Ã¥¯¤¹¤E³¡¼¥EХ寤òÀß
+ * Äꤹ¤E³¤È¤¬¤Ç¤¤E£¤Ê¤ª¡¢¥E¹¥Ê¡¼¥¯¥é¥¹¤Ï2¼Eฺߤ·¡¢¥Ð¥Ã¥Õ¥¡¥Õ
+ * ¥EäÁ÷¿®»þ¤Î¥³¡¼¥EХ寤ǡ¢¤½¤Î»þÅÀ¤Ç͸ú¤Ê¥Ç¡¼¥¿¤ò¥Õ¥¡¥ó¥¯¥¿¤Î°E * ¿ô¤È¤·¤Æ¼õ¤±¼è¤EConnectorDataListener ¤Ç¤¢¤ê¡¢¤â¤¦°Eý¤Ï¥Ç¡¼¥¿¥¨
* ¥ó¥×¥Æ¥£¤ä¥Ð¥Ã¥Õ¥¡Æɤ߹þ¤ß»þ¤Î¥¿¥¤¥à¥¢¥¦¥È¤Ê¤É¥Ç¡¼¥¿¤¬¼èÆÀ¤Ç¤¤Ê¤¤
- * ¾ì¹ç¤Ê¤É¤Ë¥³¡¼¥ë¤µ¤ì¤ë¥Õ¥¡¥ó¥¯¥¿¤Î°ú¿ô¤Ë²¿¤â¤È¤é¤Ê¤é¤¤
- * ConnecotorListener ¤¬¤¢¤ë¡£
+ * ¾Eç¤Ê¤É¤Ë¥³¡¼¥Eµ¤EEÕ¥¡¥ó¥¯¥¿¤Î°ú¿ô¤Ë²¿¤â¤È¤é¤Ê¤é¤¤
+ * ConnecotorListener ¤¬¤¢¤E£
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë¤Ï¡¢Àܳ»þ¤Ë¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®ÊýË¡¤Ë¤Ä¤¤¤Æ¥Ç¡¼¥¿¥Õ¥í¡¼·¿¡¢
- * ¥µ¥Ö¥¹¥¯¥ê¥×¥·¥ç¥ó·¿Åù¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤¤ë¡£
- * ConnectorDaataListener/ConnectorListener ¤Ï¤È¤â¤Ë¡¢ÍÍ¡¹¤Ê¥¤¥Ù¥ó¥È
- * ¤ËÂФ¹¤ë¥³¡¼¥ë¥Ð¥Ã¥¯¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤¤ë¤¬¡¢¤³¤ì¤é¥Ç¡¼¥¿¥Õ¥í¡¼·¿
- * ¤ª¤è¤Ó¥µ¥Ö¥¹¥¯¥ê¥×¥·¥ç¥ó·¿¤ÎÀßÄê¤Ë±þ¤¸¤Æ¡¢ÍøÍѲÄǽ¤Ê¤â¤ÎÍøÍÑÉÔ²Äǽ
- * ¤Ê¤â¤Î¤ä¡¢¸Æ¤Ó½Ð¤µ¤ì¤ë¥¿¥¤¥ß¥ó¥°¤¬°Û¤Ê¤ë¡£
- * °Ê²¼¤Ë¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬CORBA CDR·¿¤Î¾ì¹ç¤Î¥³¡¼¥ë¥Ð¥Ã¥¯°ìÍ÷¤ò¼¨¤¹¡£
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë¤Ï¡¢Àܳ»þ¤Ë¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®ÊýË¡¤Ë¤Ä¤¤¤Æ¥Ç¡¼¥¿¥Õ¥ú½¼·¿¡¢
+ * ¥µ¥Ö¥¹¥¯¥E×¥·¥ç¥ó·¿Åù¤òÀßÄꤹ¤E³¤È¤¬¤Ç¤¤E£
*
+ * <pre>
+ * class MyDataListener
+ * : public ConnectorDataListenerT<RTC::TimedLong>
+ * {
+ * public:
+ * MyDataListener(const char* name) : m_name(name) {}
+ * virtual ~MyDataListener() {}
+ * virtual ReturnCode operator()(ConnectorInfo& info, TimedLong& data)
+ * - Push·¿: Subscription Type¤Ë¤è¤ê¤µ¤é¤Ë¥¤¥Ù¥ó¥È¤Î¼Eबʬ¤«¤EE£
+ * std::cout << "Data Listener: " << m_name << std::endl;
+ * std::cout << "Data: " << data.data << std::endl;
+ * std::cout << "Profile::name: " << info.name << std::endl;
+ * std::cout << "Profile::id: " << info.id << std::endl;
+ * std::cout << "Profile::properties: " << std::endl;
+ * std::cout << info.properties;
+ * };
+ * std::string m_name;
+ * };
+ * </pre>
+ *
+ * ¤³¤Î¤è¤¦¤Ë¤·¤ÆÄEÁ¤µ¤E¿¥E¹¥Ê¥¯¥é¥¹¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë
+ * ÂФ·¤Æ¡¢°Ê²¼¤Î¤è¤¦¤Ë¥»¥Ã¥È¤µ¤EE£
+ *
+ * <pre>
+ * RTC::ReturnCode_t ConsoleIn::onInitialize()
+ * {
+ * m_outOut.
+ * addConnectorDataListener(ON_BUFFER_WRITE,
+ * new MyDataListener("ON_BUFFER_WRITE"));
+ * :
+ * </pre>
+ *
+ * ÂE°ú¿ô¤Î "ON_BUFFER_WRITE" ¤Ï¡¢¥³¡¼¥EХ寤ò¥Õ¥Ã¥¯¤¹¤EÝ¥¤¥ó¥È¤Ç
+ * ¤¢¤ê¡¢°Ê²¼¤ËÎóµó¤¹¤Eͤò¼è¤E³¤È¤¬²Äǽ¤Ç¤¢¤E£¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë¤Ï¡¢ÀÜ
+ * ³»þ¤Ë¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®ÊýË¡¤Ë¤Ä¤¤¤Æ¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹·¿¡¢¥Ç¡¼¥¿¥Õ¥ú½¼
+ * ·¿¡¢¥µ¥Ö¥¹¥¯¥E×¥·¥ç¥ó·¿Åù¤òÀßÄꤹ¤E³¤È¤¬¤Ç¤¤E¬¡¢¤³¤Eé¤ÎÀßÄê¤Ë
+ * ¤è¤Eե寤µ¤EEÝ¥¤¥ó¥È¤Ï°Û¤Ê¤E£°Ê²¼¤Ë¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬CORBA
+ * CDR·¿¤Î¾Eç¤Î¥³¡¼¥EХ寰E÷¤ò¼¨¤¹¡£
+ *
* OutPort:
- * - Push·¿: Subscription Type¤Ë¤è¤ê¤µ¤é¤Ë¥¤¥Ù¥ó¥È¤Î¼ïÎबʬ¤«¤ì¤ë¡£
- * - Flush: Flush·¿¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¤¬¤Ê¤¤¤¿¤á ON_BUFFER ·Ï¤Î¥¤¥Ù¥ó¥È¤ÏȯÀ¸¤·¤Ê¤¤
+ * - Push·¿: Subscription Type¤Ë¤è¤ê¤µ¤é¤Ë¥¤¥Ù¥ó¥È¤Î¼Eबʬ¤«¤EE£
+ * - Flush: Flush·¿¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¤¬¤Ê¤¤¤¿¤EON_BUFFER ·Ï¤Î¥¤¥Ù¥ó¥È¤ÏȯÀ¸¤·¤Ê¤¤
* - ON_SEND
* - ON_RECEIVED
* - ON_RECEIVER_FULL
* - ON_RECEIVER_TIMEOUT
* - ON_RECEIVER_ERROR
+ * .
+ * - Flush: Flush·¿¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¤¬¤Ê¤¤¤¿¤EON_BUFFER ·Ï¤Î¥¤¥Ù¥ó¥È¤ÏȯÀ¸¤·¤Ê¤¤
+ * - ON_SEND
+ * - ON_RECEIVED
+ * - ON_RECEIVER_FULL
+ * - ON_RECEIVER_TIMEOUT
+ * - ON_RECEIVER_ERROR
* - ON_CONNECT
* - ON_DISCONNECT
- * .
- * - New·¿
* - ON_BUFFER_WRITE
* - ON_BUFFER_FULL
* - ON_BUFFER_WRITE_TIMEOUT
@@ -128,9 +236,6 @@
* - ON_RECEIVER_ERROR
* - ON_SENDER_ERROR
* - ON_CONNECT
- * - ON_DISCONNECT
- * .
- * - Periodic·¿
* - ON_BUFFER_WRITE
* - ON_BUFFER_FULL
* - ON_BUFFER_WRITE_TIMEOUT
@@ -142,24 +247,16 @@
* - ON_RECEIVER_ERROR
* - ON_BUFFER_EMPTY
* - ON_SENDER_EMPTY
- * - ON_SENDER_ERROR
- * - ON_CONNECT
- * - ON_DISCONNECT
- * .
- * .
* - Pull·¿
* - ON_BUFFER_READ
* - ON_SEND
+ * - ON_BUFFER_WRITE
+ * - ON_BUFFER_FULL
+ * - ON_BUFFER_WRITE_TIMEOUT
+ * - ON_BUFFER_WRITE_OVERWRITE
* - ON_BUFFER_EMPTY
* - ON_BUFFER_READ_TIMEOUT
- * - ON_SENDER_EMPTY
- * - ON_SENDER_TIMEOUT
- * - ON_SENDER_ERROR
- * - ON_CONNECT
- * - ON_DISCONNECT
- *
- * InPort:
- * - Push·¿:
+ * - ON_RECEIVED
* - ON_BUFFER_WRITE
* - ON_BUFFER_FULL
* - ON_BUFFER_WRITE_TIMEOUT
@@ -166,16 +263,15 @@
* - ON_BUFFER_WRITE_OVERWRITE
* - ON_RECEIVED
* - ON_RECEIVER_FULL
+ *
+ * @else
* - ON_RECEIVER_TIMEOUT
* - ON_RECEIVER_ERROR
* - ON_CONNECT
* - ON_DISCONNECT
- * .
- * - Pull·¿
* - ON_CONNECT
* - ON_DISCONNECT
*
- * @else
* @class ConnectorDataListener class
* @brief ConnectorDataListener class
*
@@ -182,22 +278,138 @@
* This class is abstract base class for listener classes that
* provides callbacks for various events in the data port's
* connectors.
+ * such as buffer-empty event, buffer-read-timeout event and so on.
+ * @endif
+ */
+ * ConnectorDataListener, a class which inherits this class should
+ * be defined, and the functor should receive a connector
+ * information and a data value as arguments. And then, the defined
+ * class must be set to data-port object through its member
+ * function, as follows. Two types of ConnectorDataListeners are
+ * available. One is "ConnectorDataListener" which receives
+ * marshalled data as data value, the other is
+ * "ConnectorDataListenerT" which receives unmarshalled data as data
+ * value. The following example is the use of ConnectorDataListenerT.
*
+ * <pre>
+ * class MyDataListener
+ * : public ConnectorDataListenerT<RTC::TimedLong>
+ * {
+ * public:
+ * MyDataListener(const char* name) : m_name(name) {}
+ * virtual ~MyDataListener() {}
+ * virtual ReturnCode operator()(ConnectorInfo& info, TimedLong& data)
+ * {
+ * std::cout << "Data Listener: " << m_name << std::endl;
+ * std::cout << "Data: " << data.data << std::endl;
+ * std::cout << "Profile::name: " << info.name << std::endl;
+ * std::cout << "Profile::id: " << info.id << std::endl;
+ * std::cout << "Profile::properties: " << std::endl;
+ * std::cout << info.properties;
+ * };
+ * std::string m_name;
+ * };
+ * </pre>
+ *
+ * The listener class defained as above can be attached to a
+ * data-port as follows.
+ *
+ * <pre>
+ * RTC::ReturnCode_t ConsoleIn::onInitialize()
+ * {
+ * m_outOut.
+ * addConnectorDataListener(ON_BUFFER_WRITE,
+ * new MyDataListener("ON_BUFFER_WRITE"));
+ * :
+ * </pre>
+ *
+ * The first argument "ON_BUFFER_WRITE" specifies hook point of
+ * callback, and the following values are available. Data-port can
+ * be specified some properties such as interface-type,
+ * dataflow-type, subscription type and so on. Available hook points
+ * vary by the those settings. The following hook points are
+ * available when interface type is CORBA CDR type.
+ *
+ * OutPort:
+ * - Push type: Available hook event varies by subscription type.
+ * - Flush: No ON_BUFFER* events since flush-type has no buffer.
+ * - ON_SEND
+ * - ON_RECEIVED
+ * - ON_RECEIVER_FULL
+ * - ON_RECEIVER_TIMEOUT
+ * - ON_RECEIVER_ERROR
+ * .
+ * - New type:
+ * - ON_BUFFER_WRITE
+ * - ON_BUFFER_FULL
+ * - ON_BUFFER_WRITE_TIMEOUT
+ * - ON_BUFFER_OVERWRITE
+ * - ON_BUFFER_READ
+ * - ON_SEND
+ * - ON_RECEIVED
+ * - ON_RECEIVER_FULL
+ * - ON_RECEIVER_TIMEOUT
+ * - ON_RECEIVER_ERROR
+ * .
+ * - Periodic type:
+ * - ON_BUFFER_WRITE
+ * - ON_BUFFER_FULL
+ * - ON_BUFFER_WRITE_TIMEOUT
+ * - ON_BUFFER_READ
+ * - ON_SEND
+ * - ON_RECEIVED
+ * - ON_RECEIVER_FULL
+ * - ON_RECEIVER_TIMEOUT
+ * - ON_RECEIVER_ERROR
+ * .
+ * .
+ * - Pull type:
+ * - ON_BUFFER_WRITE
+ * - ON_BUFFER_FULL
+ * - ON_BUFFER_WRITE_TIMEOUT
+ * - ON_BUFFER_OVERWRITE
+ * - ON_BUFFER_READ
+ * - ON_SEND
+ * .
+ * InPort:
+ * - Push type:
+ * - ON_BUFFER_WRITE
+ * - ON_BUFFER_FULL
+ * - ON_BUFFER_WRITE_TIMEOUT
+ * - ON_BUFFER_WRITE_OVERWRITE
+ * - ON_BUFFER_READ
+ * - ON_BUFFER_READ_TIMEOUT
+ * - ON_RECEIVED
+ * - ON_RECEIVER_FULL
+ * - ON_RECEIVER_TIMEOUT
+ * - ON_RECEIVER_ERROR
+ * .
+ * - Pull type
+ * - ON_BUFFER_READ
+ *
* @endif
*/
class ConnectorDataListener
+ : public ConnectorListenerStatus
{
public:
+ USE_CONNLISTENER_STATUS;
/*!
* @if jp
+ class ConnectorDataListener
+ {
+ public:
+ * ConnectorDataListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤E *
+ /*!
+ * @if jp
+ * @return ʸ»úÎóÊÑ´¹·EÌ
*
* @brief ConnectorDataListenerType ¤òʸ»úÎó¤ËÊÑ´¹
*
- * ConnectorDataListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë
- *
+ * ConnectorDataListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤E *
* @param type ÊÑ´¹ÂÐ¾Ý ConnectorDataListenerType
*
- * @return ʸ»úÎóÊÑ´¹·ë²Ì
+ * @return ʸ»úÎóÊÑ´¹·EÌ
*
* @else
*
@@ -243,10 +455,10 @@
/*!
* @if jp
*
- * @brief ²¾ÁÛ¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+ * @brief ²¾ÁÛ¥³¡¼¥EХ寥᥽¥Ã¥É
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥³¡¼
- * ¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ËÂФ¹¤E³¡¼
+ * ¥EХ寥᥽¥Ã¥É
*
* @else
*
@@ -258,21 +470,20 @@
*/
virtual void operator()(const ConnectorInfo& info,
const cdrMemoryStream& data) = 0;
+ * ¥EХ寤ò¼Â¸½¤¹¤EE¹¥Ê¥¯¥é¥¹¤Î´ðÄE¯¥é¥¹¡£
+ *
-
- };
-
/*!
* @if jp
* @class ConnectorDataListenerT ¥¯¥é¥¹
* @brief ConnectorDataListenerT ¥¯¥é¥¹
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥³¡¼
- * ¥ë¥Ð¥Ã¥¯¤ò¼Â¸½¤¹¤ë¥ê¥¹¥Ê¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¡£
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ËÂФ¹¤E³¡¼
+ * ¥EХ寤ò¼Â¸½¤¹¤EE¹¥Ê¥¯¥é¥¹¤Î´ðÄE¯¥é¥¹¡£
*
- * ¤³¤Î¥¯¥é¥¹¤Ï¡¢operator()() ¤ÎÂè2°ú¿ô¤Ë cdrMemoryStream ·¿¤Ç¤Ï¤Ê¤¯¡¢
- * ¼ÂºÝ¤Ë¥Ç¡¼¥¿¥Ý¡¼¥È¤Ç»ÈÍѤµ¤ì¤ëÊÑ¿ô·¿¤ò¥Æ¥ó¥×¥ì¡¼¥È°ú¿ô¤È¤·¤Æ
- * ÅϤ¹¤³¤È¤¬¤Ç¤¤ë¡£
+ * ¤³¤Î¥¯¥é¥¹¤Ï¡¢operator()() ¤ÎÂE°ú¿ô¤Ë cdrMemoryStream ·¿¤Ç¤Ï¤Ê¤¯¡¢
+ * ¼ÂºÝ¤Ë¥Ç¡¼¥¿¥Ý¡¼¥È¤Ç»ÈÍѤµ¤EEÑ¿ô·¿¤ò¥Æ¥ó¥×¥E¼¥È°ú¿ô¤È¤·¤Æ
+ * ÅϤ¹¤³¤È¤¬¤Ç¤¤E£
*
* @else
* @class ConnectorDataListenerT class
@@ -305,10 +516,10 @@
/*!
* @if jp
*
- * @brief ¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+ * @brief ¥³¡¼¥EХ寥᥽¥Ã¥É
*
- * ¥Ç¡¼¥¿¤ò¥Ç¡¼¥¿¥Ý¡¼¥È¤Ç»ÈÍѤµ¤ì¤ëÊÑ¿ô·¿¤ËÊÑ´¹¤·¤Æ ConnectorDataListenerT
- * ¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
+ * ¥Ç¡¼¥¿¤ò¥Ç¡¼¥¿¥Ý¡¼¥È¤Ç»ÈÍѤµ¤EEÑ¿ô·¿¤ËÊÑ´¹¤·¤Æ ConnectorDataListenerT
+ * ¤Î¥³¡¼¥EХ寥᥽¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
*
* @param info ConnectorInfo
* @param cdrdata cdrMemoryStream·¿¤Î¥Ç¡¼¥¿
@@ -336,7 +547,6 @@
#else
cdrMemoryStream cdr(cdrdata.bufPtr(), cdrdata.bufSize());
#endif
-
// endian type check
std::string endian_type;
endian_type = info.properties.getProperty("serializer.cdr.endian",
@@ -379,10 +589,10 @@
/*!
* @if jp
*
- * @brief ²¾ÁÛ¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+ * @brief ²¾ÁÛ¥³¡¼¥EХ寥᥽¥Ã¥É
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥³¡¼
- * ¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ËÂФ¹¤E³¡¼
+ * ¥EХ寥᥽¥Ã¥É
*
* @else
*
@@ -396,17 +606,13 @@
virtual void operator()(const ConnectorInfo& info,
const DataType& data) = 0;
- };
-
-
+ * - ON_SENDER_ERROR: OutPort¦¥¨¥é¡¼»þ
+ * - ON_CONNECT: Àܳ³ÎΩ»þ
/*!
* @if jp
* @brief ConnectorListener ¤Î¥¿¥¤¥×
*
- * - ON_BUFFER_EMPTY: ¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Î¾ì¹ç
- * - ON_BUFFER_READTIMEOUT: ¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Ç¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¾ì¹ç
- * - ON_SENDER_EMPTY: OutPort¦¥Ð¥Ã¥Õ¥¡¤¬¶õ
- * - ON_SENDER_TIMEOUT: OutPort¦¥¿¥¤¥à¥¢¥¦¥È»þ
+ * - ON_BUFFER_EMPTY: ¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Î¾EE * - ON_BUFFER_READTIMEOUT: ¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Ç¥¿¥¤¥à¥¢¥¦¥È¤·¤¿¾EE * - ON_SENDER_EMPTY: OutPort¦¥Ð¥Ã¥Õ¥¡¤¬¶E * - ON_SENDER_TIMEOUT: OutPort¦¥¿¥¤¥à¥¢¥¦¥È»þ
* - ON_SENDER_ERROR: OutPort¦¥¨¥é¡¼»þ
* - ON_CONNECT: Àܳ³ÎΩ»þ
* - ON_DISCONNECT: ÀܳÀÚÃÇ»þ
@@ -434,78 +640,87 @@
ON_CONNECT,
ON_DISCONNECT,
CONNECTOR_LISTENER_NUM
- };
-
- /*!
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ËÂФ¹¤E³¡¼
+ * ¥EХ寤ò¼Â¸½¤¹¤EE¹¥Ê¥¯¥é¥¹¤Î´ðÄE¯¥é¥¹¡£
+ *
* @if jp
* @class ConnectorListener ¥¯¥é¥¹
* @brief ConnectorListener ¥¯¥é¥¹
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥³¡¼
- * ¥ë¥Ð¥Ã¥¯¤ò¼Â¸½¤¹¤ë¥ê¥¹¥Ê¥¯¥é¥¹¤Î´ðÄ쥯¥é¥¹¡£
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ËÂФ¹¤E³¡¼
+ * ¥EХ寤ò¼Â¸½¤¹¤EE¹¥Ê¥¯¥é¥¹¤Î´ðÄE¯¥é¥¹¡£
*
- * ¥³¥¢¥í¥¸¥Ã¥¯¤¬OutPort¤ËÂФ·¤Æ¥Ç¡¼¥¿½ñ¤¹þ¤ß¡¢InPort¦¤Ç¥Ç¡¼¥¿¤¬¼è
- * ÆÀ¤µ¤ì¤ë¤Þ¤Ç¤Î´Ö¤ÇȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ò¥Õ¥Ã¥¯¤¹¤ë¥³¡¼¥ë¥Ð¥Ã¥¯¤òÀß
- * Äꤹ¤ë¤³¤È¤¬¤Ç¤¤ë¡£¤Ê¤ª¡¢¥ê¥¹¥Ê¡¼¥¯¥é¥¹¤Ï2¼ïÎฺߤ·¡¢¥Ð¥Ã¥Õ¥¡¥Õ
- * ¥ë¤äÁ÷¿®»þ¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¤Ç¡¢¤½¤Î»þÅÀ¤Ç͸ú¤Ê¥Ç¡¼¥¿¤ò¥Õ¥¡¥ó¥¯¥¿¤Î°ú
- * ¿ô¤È¤·¤Æ¼õ¤±¼è¤ë ConnectorDataListener ¤Ç¤¢¤ê¡¢¤â¤¦°ìÊý¤Ï¥Ç¡¼¥¿¥¨
+ * ¥³¥¢¥úÁ¸¥Ã¥¯¤¬OutPort¤ËÂФ·¤Æ¥Ç¡¼¥¿½ñ¤¹þ¤ß¡¢InPort¦¤Ç¥Ç¡¼¥¿¤¬¼E * ÆÀ¤µ¤EEޤǤδ֤ÇȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ò¥Õ¥Ã¥¯¤¹¤E³¡¼¥EХ寤òÀß
+ * Äꤹ¤E³¤È¤¬¤Ç¤¤E£¤Ê¤ª¡¢¥E¹¥Ê¡¼¥¯¥é¥¹¤Ï2¼Eฺߤ·¡¢¥Ð¥Ã¥Õ¥¡¥Õ
+ * ¥EäÁ÷¿®»þ¤Î¥³¡¼¥EХ寤ǡ¢¤½¤Î»þÅÀ¤Ç͸ú¤Ê¥Ç¡¼¥¿¤ò¥Õ¥¡¥ó¥¯¥¿¤Î°E * ¿ô¤È¤·¤Æ¼õ¤±¼è¤EConnectorDataListener ¤Ç¤¢¤ê¡¢¤â¤¦°Eý¤Ï¥Ç¡¼¥¿¥¨
* ¥ó¥×¥Æ¥£¤ä¥Ð¥Ã¥Õ¥¡Æɤ߹þ¤ß»þ¤Î¥¿¥¤¥à¥¢¥¦¥È¤Ê¤É¥Ç¡¼¥¿¤¬¼èÆÀ¤Ç¤¤Ê¤¤
- * ¾ì¹ç¤Ê¤É¤Ë¥³¡¼¥ë¤µ¤ì¤ë¥Õ¥¡¥ó¥¯¥¿¤Î°ú¿ô¤Ë²¿¤â¤È¤é¤Ê¤é¤¤
- * ConnecotorListener ¤¬¤¢¤ë¡£
+ * ¾Eç¤Ê¤É¤Ë¥³¡¼¥Eµ¤EEÕ¥¡¥ó¥¯¥¿¤Î°ú¿ô¤Ë²¿¤â¤È¤é¤Ê¤é¤¤
+ * ConnecotorListener ¤¬¤¢¤E£
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë¤Ï¡¢Àܳ»þ¤Ë¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®ÊýË¡¤Ë¤Ä¤¤¤Æ¥Ç¡¼¥¿¥Õ¥í¡¼·¿¡¢
- * ¥µ¥Ö¥¹¥¯¥ê¥×¥·¥ç¥ó·¿Åù¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤¤ë¡£
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë¤Ï¡¢Àܳ»þ¤Ë¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®ÊýË¡¤Ë¤Ä¤¤¤Æ¥Ç¡¼¥¿¥Õ¥ú½¼·¿¡¢
+ * ¥µ¥Ö¥¹¥¯¥E×¥·¥ç¥ó·¿Åù¤òÀßÄꤹ¤E³¤È¤¬¤Ç¤¤E£
* ConnectorDaataListener/ConnectorListener ¤Ï¶¦¤Ë¤Ë¡¢ÍÍ¡¹¤Ê¥¤¥Ù¥ó¥È
- * ¤ËÂФ¹¤ë¥³¡¼¥ë¥Ð¥Ã¥¯¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤¤ë¤¬¡¢¤³¤ì¤é¥Ç¡¼¥¿¥Õ¥í¡¼·¿
- * ¤ª¤è¤Ó¥µ¥Ö¥¹¥¯¥ê¥×¥·¥ç¥ó·¿¤ÎÀßÄê¤Ë±þ¤¸¤Æ¡¢ÍøÍѤǤ¤ë¤â¤Î¡¢¤Ç¤¤Ê¤¤
- * ¤â¤Î¡¢¤Þ¤¿¸Æ¤Ó½Ð¤µ¤ì¤ë¥¿¥¤¥ß¥ó¥°¤¬°Û¤Ê¤ë¡£°Ê²¼¤Ë¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹
- * ¤¬CORBA CDR·¿¤Î¾ì¹ç¤Î¥³¡¼¥ë¥Ð¥Ã¥¯°ìÍ÷¤ò¼¨¤¹¡£
+ * ¤ËÂФ¹¤E³¡¼¥EХ寤òÀßÄꤹ¤E³¤È¤¬¤Ç¤¤E¬¡¢¤³¤Eé¥Ç¡¼¥¿¥Õ¥ú½¼·¿
+ * ¤ª¤è¤Ó¥µ¥Ö¥¹¥¯¥E×¥·¥ç¥ó·¿¤ÎÀßÄê¤Ë±þ¤¸¤Æ¡¢ÍøÍѤǤ¤Eâ¤Î¡¢¤Ç¤¤Ê¤¤
+ * ¤â¤Î¡¢¤Þ¤¿¸Æ¤Ó½Ð¤µ¤EE¿¥¤¥ß¥ó¥°¤¬°Û¤Ê¤E£°Ê²¼¤Ë¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹
+ * ¤¬CORBA CDR·¿¤Î¾Eç¤Î¥³¡¼¥EХ寰E÷¤ò¼¨¤¹¡£
*
+ * std::cout << "Profile::name: " << info.name << std::endl;
+ * std::cout << "Profile::id: " << info.id << std::endl;
+ * std::cout << "Profile::properties: " << std::endl;
+ * std::cout << info.properties;
+ * - ON_RECEIVER_ERROR
+ * std::string m_name;
+ * };
+ * </pre>
+ *
+ * ¤³¤Î¤è¤¦¤Ë¤·¤ÆÄEÁ¤µ¤E¿¥E¹¥Ê¥¯¥é¥¹¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë
+ * ÂФ·¤Æ¡¢°Ê²¼¤Î¤è¤¦¤Ë¥»¥Ã¥È¤µ¤EE£
+ *
+ * <pre>
+ * RTC::ReturnCode_t ConsoleIn::onInitialize()
+ * {
+ * m_outOut.
+ * addConnectorListener(ON_BUFFER_EMPTY,
+ * new MyListener("ON_BUFFER_EMPTY"));
+ * :
+ * </pre>
+ *
+ * ÂE°ú¿ô¤Î "ON_BUFFER_EMPTY" ¤Ï¡¢¥³¡¼¥EХ寤ò¥Õ¥Ã¥¯¤¹¤EÝ¥¤¥ó¥È¤Ç
+ * ¤¢¤ê¡¢°Ê²¼¤ËÎóµó¤¹¤Eͤò¼è¤E³¤È¤¬²Äǽ¤Ç¤¢¤E£¥Ç¡¼¥¿¥Ý¡¼¥È¤Ë¤Ï¡¢ÀÜ
+ * ³»þ¤Ë¥Ç¡¼¥¿¤ÎÁ÷¼õ¿®ÊýË¡¤Ë¤Ä¤¤¤Æ¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹·¿¡¢¥Ç¡¼¥¿¥Õ¥ú½¼
+ * ·¿¡¢¥µ¥Ö¥¹¥¯¥E×¥·¥ç¥ó·¿Åù¤òÀßÄꤹ¤E³¤È¤¬¤Ç¤¤E¬¡¢¤³¤Eé¤ÎÀßÄê¤Ë
+ * ¤è¤Eե寤µ¤EEÝ¥¤¥ó¥È¤Ï°Û¤Ê¤E£°Ê²¼¤Ë¡¢¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬CORBA
+ * CDR·¿¤Î¾Eç¤Î¥³¡¼¥EХ寰E÷¤ò¼¨¤¹¡£
+ *
* OutPort:
- * - Push·¿: Subscription Type¤Ë¤è¤ê¤µ¤é¤Ë¥¤¥Ù¥ó¥È¤Î¼ïÎबʬ¤«¤ì¤ë¡£
- * - Flush: Flush·¿¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¤¬¤Ê¤¤¤¿¤á ON_BUFFER ·Ï¤Î¥¤¥Ù¥ó¥È¤ÏȯÀ¸¤·¤Ê¤¤
- * - ON_SEND
- * - ON_RECEIVED
- * - ON_RECEIVER_FULL
- * - ON_RECEIVER_TIMEOUT
- * - ON_RECEIVER_ERROR
+ * - Push·¿: Subscription Type¤Ë¤è¤ê¤µ¤é¤Ë¥¤¥Ù¥ó¥È¤Î¼Eबʬ¤«¤EE£
+ * - Flush: Flush·¿¤Ë¤Ï¥Ð¥Ã¥Õ¥¡¤¬¤Ê¤¤¤¿¤EON_BUFFER ·Ï¤Î¥¤¥Ù¥ó¥È¤ÏȯÀ¸¤·¤Ê¤¤
* - ON_CONNECT
* - ON_DISCONNECT
* .
* - New·¿
- * - ON_BUFFER_WRITE
- * - ON_BUFFER_FULL
- * - ON_BUFFER_WRITE_TIMEOUT
- * - ON_BUFFER_OVERWRITE
- * - ON_BUFFER_READ
- * - ON_SEND
- * - ON_RECEIVED
- * - ON_RECEIVER_FULL
- * - ON_RECEIVER_TIMEOUT
- * - ON_RECEIVER_ERROR
- * - ON_SENDER_ERROR
* - ON_CONNECT
* - ON_DISCONNECT
* .
* - Periodic·¿
- * - ON_BUFFER_WRITE
- * - ON_BUFFER_FULL
- * - ON_BUFFER_WRITE_TIMEOUT
- * - ON_BUFFER_READ
- * - ON_SEND
- * - ON_RECEIVED
- * - ON_RECEIVER_FULL
- * - ON_RECEIVER_TIMEOUT
- * - ON_RECEIVER_ERROR
* - ON_BUFFER_EMPTY
+ * - ON_BUFFER_READ_TIMEOUT
* - ON_SENDER_EMPTY
* - ON_SENDER_ERROR
* - ON_CONNECT
* - ON_DISCONNECT
* .
+ * - ON_BUFFER_READ
+ * - ON_SEND
+ * - ON_RECEIVED
+ * - ON_RECEIVER_FULL
+ * - ON_SEND
+ * - ON_RECEIVED
+ * - ON_RECEIVER_FULL
+ * - ON_RECEIVER_TIMEOUT
+ * - ON_BUFFER_READ
* .
- * - Pull·¿
- * - ON_BUFFER_READ
* - ON_SEND
* - ON_BUFFER_EMPTY
* - ON_BUFFER_READ_TIMEOUT
@@ -513,8 +728,6 @@
* - ON_SENDER_TIMEOUT
* - ON_SENDER_ERROR
* - ON_CONNECT
- * - ON_DISCONNECT
- *
* InPort:
* - Push·¿:
* - ON_BUFFER_WRITE
@@ -522,17 +735,11 @@
* - ON_BUFFER_WRITE_TIMEOUT
* - ON_BUFFER_WRITE_OVERWRITE
* - ON_RECEIVED
- * - ON_RECEIVER_FULL
+ *
* - ON_RECEIVER_TIMEOUT
* - ON_RECEIVER_ERROR
- * - ON_CONNECT
- * - ON_DISCONNECT
- * .
- * - Pull·¿
- * - ON_CONNECT
- * - ON_DISCONNECT
+ * connectors.
*
- * @else
* @class ConnectorListener class
* @brief ConnectorListener class
*
@@ -545,16 +752,109 @@
class ConnectorListener
{
public:
+ * class must be set to data-port object through its member
+ * @if jp
+ *
+ * <pre>
+ * class MyListener
+ * : public ConnectorListener
+ * {
+ * public:
+ * MyListener(const char* name) : m_name(name) {}
+ * virtual ~MyListener() {}
+ * virtual ReturnCode operator()(ConnectorInfo& info)
+ * {
+ * std::cout << "Data Listener: " << m_name << std::endl;
+ * std::cout << "Profile::name: " << info.name << std::endl;
+ * std::cout << "Profile::id: " << info.id << std::endl;
+ * std::cout << "Profile::properties: " << std::endl;
+ * std::cout << info.properties;
+ * };
+ * std::string m_name;
+ * };
+ * </pre>
+ *
+ * The listener class defained as above can be attached to a
+ * data-port as follows.
+ *
+ * <pre>
+ * RTC::ReturnCode_t ConsoleIn::onInitialize()
+ * {
+ * m_outOut.
+ * addConnectorListener(ON_BUFFER_EMPTY,
+ * new MyDataListener("ON_BUFFER_EMPTY"));
+ * :
+ * </pre>
+ *
+ * The first argument "ON_BUFFER_EMPTY" specifies hook point of
+ * callback, and the following values are available. Data-port can
+ * be specified some properties such as interface-type,
+ * dataflow-type, subscription type and so on. Available hook points
+ * vary by the those settings. The following hook points are
+ * available when interface type is CORBA CDR type.
+ *
+ * OutPort:
+ * - Push type: Available hook event varies by subscription type.
+ * - Flush: No ON_BUFFER* events since flush-type has no buffer.
+ * - ON_CONNECT
+ * - ON_DISCONNECT
+ * .
+ * - New type:
+ * - ON_CONNECT
+ * - ON_DISCONNECT
+ * .
+ * - Periodic type:
+ * - ON_BUFFER_EMPTY
+ * - ON_BUFFER_READ_TIMEOUT
+ * - ON_SENDER_EMPTY
+ * - ON_SENDER_ERROR
+ * - ON_CONNECT
+ * - ON_DISCONNECT
+ * .
+ * .
+ * - Pull type:
+ * - ON_BUFFER_EMPTY
+ * - ON_BUFFER_READ_TIMEOUT
+ * - ON_SENDER_EMPTY
+ * - ON_SENDER_TIMEOUT
+ * - ON_SENDER_ERROR
+ * - ON_CONNECT
+ * - ON_DISCONNECT
+ * .
+ * InPort:
+ * - Push type:
+ * - ON_BUFFER_EMPTY
+ * - ON_BUFFER_READ_TIMEOUT
+ * - ON_CONNECT
+ * - ON_DISCONNECT
+ * .
+ * - Pull type:
+ * - ON_CONNECT
+ * - ON_DISCONNECT
+ *
+ * @endif
+ */
+ class ConnectorListener
+ : public ConnectorListenerStatus
+ {
+ public:
+ USE_CONNLISTENER_STATUS;
/*!
* @if jp
*
* @brief ConnectorListenerType ¤òʸ»úÎó¤ËÊÑ´¹
*
- * ConnectorListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë
+ * ConnectorListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤E *
+ * @param type ÊÑ´¹ÂÐ¾Ý ConnectorListenerType
*
+ * @brief ConnectorListenerType ¤òʸ»úÎó¤ËÊÑ´¹
+ *
+ * ConnectorListenerType ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤E *
+ *
* @param type ÊÑ´¹ÂÐ¾Ý ConnectorListenerType
*
- * @return ʸ»úÎóÊÑ´¹·ë²Ì
+ * Convert ConnectorListenerType into the string.
+ * @return ʸ»úÎóÊÑ´¹·EÌ
*
* @else
*
@@ -597,10 +897,10 @@
/*!
* @if jp
*
- * @brief ²¾ÁÛ¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+ * @brief ²¾ÁÛ¥³¡¼¥EХ寥᥽¥Ã¥É
*
- * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤ë³Æ¼ï¥¤¥Ù¥ó¥È¤ËÂФ¹¤ë¥³¡¼
- * ¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É
+ * ¥Ç¡¼¥¿¥Ý¡¼¥È¤Î Connector ¤Ë¤ª¤¤¤ÆȯÀ¸¤¹¤EƼE¤¥Ù¥ó¥È¤ËÂФ¹¤E³¡¼
+ * ¥EХ寥᥽¥Ã¥É
*
* @else
*
@@ -618,10 +918,10 @@
/*!
* @if jp
* @class ConnectorDataListenerHolder
- * @brief ConnectorDataListener ¥Û¥ë¥À¥¯¥é¥¹
+ * @brief ConnectorDataListener ¥Û¥EÀ¥¯¥é¥¹
*
- * Ê£¿ô¤Î ConnectorDataListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤ë¥¯¥é¥¹¡£
*
+ *
* @else
* @class ConnectorDataListenerHolder
* @brief ConnectorDataListener holder class
@@ -640,10 +940,12 @@
* @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
* @else
* @brief Constructor
+ * @brief ¥Ç¥¹¥È¥é¥¯¥¿
* @endif
*/
ConnectorDataListenerHolder();
/*!
+ virtual ~ConnectorDataListenerHolder();
* @if jp
* @brief ¥Ç¥¹¥È¥é¥¯¥¿
* @else
@@ -655,13 +957,13 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤ÎÄɲÃ
+ * @brief ¥E¹¥Ê¡¼¤ÎÄɲÃ
*
- * ¥ê¥¹¥Ê¡¼¤òÄɲ乤롣
+ * ¥E¹¥Ê¡¼¤òÄɲ乤E£
*
- * @param listener Äɲ乤ë¥ê¥¹¥Ê
- * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤¹¤ë,
- * false:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤·¤Ê¤¤
+ * @param listener Äɲ乤EE¹¥Ê
+ * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤ÇºEE¹¤E
+ * false:¥Ç¥¹¥È¥é¥¯¥¿¤ÇºEE·¤Ê¤¤
* @else
*
* @brief Add the listener.
@@ -678,11 +980,10 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤Îºï½ü
+ * @brief ¥E¹¥Ê¡¼¤ÎºEE *
+ * ¥E¹¥Ê¤òºEE¹¤E£
*
- * ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
- *
- * @param listener ºï½ü¤¹¤ë¥ê¥¹¥Ê
+ * @param listener ºEE¹¤EE¹¥Ê
* @else
*
* @brief Remove the listener.
@@ -697,13 +998,11 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤Î¿ô¤òÆÀ¤ë
+ * @brief ¥E¹¥Ê¡¼¤Î¿ô¤òÆÀ¤E *
+ * ¸½ºßÅÐÏ¿¤µ¤EƤ¤¤EE¹¥Ê¡¼¿ô¤òÆÀ¤E£
*
- * ¸½ºßÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¡¼¿ô¤òÆÀ¤ë¡£
+ * @return listener¿E * @else
*
- * @return listener¿ô
- * @else
- *
* @brief Getting number of listeners.
*
* This method returns current number of listenrs.
@@ -716,10 +1015,9 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤ØÄÌÃΤ¹¤ë
+ * @brief ¥E¹¥Ê¡¼¤ØÄÌÃΤ¹¤E *
+ * ÅÐÏ¿¤µ¤EƤ¤¤EE¹¥Ê¤Î¥³¡¼¥EХ寥᥽¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
*
- * ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
- *
* @param info ConnectorInfo
* @param cdrdata ¥Ç¡¼¥¿
* @else
@@ -738,15 +1036,15 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤ØÄÌÃΤ¹¤ë(¥Ç¡¼¥¿·¿»ØÄêÈÇ)
+ * @brief ¥E¹¥Ê¡¼¤ØÄÌÃΤ¹¤E¥Ç¡¼¥¿·¿»ØÄEÇ)
*
- * ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
- * COnnectorDataListenerT ·¿¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¤Î¤ß¥³¡¼¥ë¤µ¤ì¤ë¡£
+ * ÅÐÏ¿¤µ¤EƤ¤¤EE¹¥Ê¤Î¥³¡¼¥EХ寥᥽¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
+ * COnnectorDataListenerT ·¿¤Î¥³¡¼¥EХ寤Τߥ³¡¼¥Eµ¤EE£
*
* @param info ConnectorInfo
* @param typeddata ¥Ç¡¼¥¿¡Ê¥Ç¡¼¥¿·¿»ØÄꤢ¤ê¡Ë
- * @else
- *
+ * @param info ConnectorInfo
+ * @param typeddata Data
* @brief Notify listeners. (Typed data version)
*
* This calls the Callback method of the registered listener.
@@ -754,7 +1052,7 @@
*
* @param info ConnectorInfo
* @param typeddata Data
- * @endif
+ for (int i(0), len(m_listeners.size()); i < len; ++i)
*/
template <class DataType>
void notify(const ConnectorInfo& info, const DataType& typeddata)
@@ -770,9 +1068,10 @@
listener->operator()(info, typeddata);
}
}
- }
+ return ret;
private:
+ private:
std::vector<Entry> m_listeners;
coil::Mutex m_mutex;
};
@@ -781,9 +1080,9 @@
/*!
* @if jp
* @class ConnectorListenerHolder
- * @brief ConnectorListener ¥Û¥ë¥À¥¯¥é¥¹
+ * @brief ConnectorListener ¥Û¥EÀ¥¯¥é¥¹
*
- * Ê£¿ô¤Î ConnectorListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤ë¥¯¥é¥¹¡£
+ * Ê£¿ô¤Î ConnectorListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤E¯¥é¥¹¡£
*
* @else
* @class ConnectorListenerHolder
@@ -790,7 +1089,14 @@
* @brief ConnectorListener holder class
*
* This class manages one ore more instances of ConnectorListener class.
+ * Ê£¿ô¤Î ConnectorListener ¤òÊÝ»ý¤·´ÉÍý¤¹¤E¯¥é¥¹¡£
*
+ * @else
+ * @class ConnectorListenerHolder
+ * @brief ConnectorListener holder class
+ *
+ * This class manages one ore more instances of ConnectorListener class.
+ *
* @endif
*/
class ConnectorListenerHolder
@@ -807,10 +1113,12 @@
*/
ConnectorListenerHolder();
+ * @endif
/*!
* @if jp
* @brief ¥Ç¥¹¥È¥é¥¯¥¿
* @else
+ * @if jp
* @brief Destructor
* @endif
*/
@@ -819,13 +1127,13 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤ÎÄɲÃ
+ * @brief ¥E¹¥Ê¡¼¤ÎÄɲÃ
*
- * ¥ê¥¹¥Ê¡¼¤òÄɲ乤롣
+ * ¥E¹¥Ê¡¼¤òÄɲ乤E£
*
- * @param listener Äɲ乤ë¥ê¥¹¥Ê
- * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤¹¤ë,
- * false:¥Ç¥¹¥È¥é¥¯¥¿¤Çºï½ü¤·¤Ê¤¤
+ * @param listener Äɲ乤EE¹¥Ê
+ * @param autoclean true:¥Ç¥¹¥È¥é¥¯¥¿¤ÇºEE¹¤E
+ * false:¥Ç¥¹¥È¥é¥¯¥¿¤ÇºEE·¤Ê¤¤
* @else
*
* @brief Add the listener.
@@ -842,11 +1150,10 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤Îºï½ü
+ * @brief ¥E¹¥Ê¡¼¤ÎºEE *
+ * ¥E¹¥Ê¤òºEE¹¤E£
*
- * ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£
- *
- * @param listener ºï½ü¤¹¤ë¥ê¥¹¥Ê
+ * @param listener ºEE¹¤EE¹¥Ê
* @else
*
* @brief Remove the listener.
@@ -861,13 +1168,11 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤Î¿ô¤òÆÀ¤ë
+ * @brief ¥E¹¥Ê¡¼¤Î¿ô¤òÆÀ¤E *
+ * ¸½ºßÅÐÏ¿¤µ¤EƤ¤¤EE¹¥Ê¡¼¿ô¤òÆÀ¤E£
*
- * ¸½ºßÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¡¼¿ô¤òÆÀ¤ë¡£
+ * @return listener¿E * @else
*
- * @return listener¿ô
- * @else
- *
* @brief Getting number of listeners.
*
* This method returns current number of listenrs.
@@ -880,10 +1185,9 @@
/*!
* @if jp
*
- * @brief ¥ê¥¹¥Ê¡¼¤ØÄÌÃΤ¹¤ë
+ * @brief ¥E¹¥Ê¡¼¤ØÄÌÃΤ¹¤E *
+ * ÅÐÏ¿¤µ¤EƤ¤¤EE¹¥Ê¤Î¥³¡¼¥EХ寥᥽¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
*
- * ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥ê¥¹¥Ê¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£
- *
* @param info ConnectorInfo
* @else
*
@@ -911,7 +1215,7 @@
* @class ConnectorListeners
* @brief ConnectorListeners class
*
- *
+ * @if jp
* @endif
*/
class ConnectorListeners
@@ -919,8 +1223,7 @@
public:
/*!
* @if jp
- * @brief ConnectorDataListenerType¥ê¥¹¥ÊÇÛÎó
- * ConnectorDataListenerType¥ê¥¹¥Ê¤ò³ÊǼ
+ * @brief ConnectorDataListenerType¥E¹¥ÊÇÛÎE * ConnectorDataListenerType¥E¹¥Ê¤ò³ÊǼ
* @else
* @brief ConnectorDataListenerType listener array
* The ConnectorDataListenerType listener is stored.
@@ -929,15 +1232,8 @@
ConnectorDataListenerHolder connectorData_[CONNECTOR_DATA_LISTENER_NUM];
/*!
* @if jp
- * @brief ConnectorListenerType¥ê¥¹¥ÊÇÛÎó
- * ConnectorListenerType¥ê¥¹¥Ê¤ò³ÊǼ
+ * @brief ConnectorListenerType¥E¹¥ÊÇÛÎE * ConnectorListenerType¥E¹¥Ê¤ò³ÊǼ
* @else
* @brief ConnectorListenerType listener array
* The ConnectorListenerType listener is stored.
* @endif
- */
- ConnectorListenerHolder connector_[CONNECTOR_LISTENER_NUM];
- };
-};
-
-#endif // RTC_CONNECTORLISTENER_H
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -36,6 +36,7 @@
#include <rtm/CdrBufferBase.h>
#include <rtm/PortCallback.h>
#include <rtm/InPortConnector.h>
+#include <rtm/Timestamp.h>
namespace RTC
{
@@ -157,6 +158,10 @@
m_OnRead(NULL), m_OnReadConvert(NULL),
m_status(1), m_directNewData(false)
{
+ this->addConnectorDataListener(ON_RECEIVED,
+ new Timestamp<DataType>("on_received"));
+ this->addConnectorDataListener(ON_BUFFER_READ,
+ new Timestamp<DataType>("on_read"));
}
/*!
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -144,7 +144,7 @@
*
* @endif
*/
- virtual ReturnCode put(const cdrMemoryStream& data) = 0;
+ virtual ReturnCode put(cdrMemoryStream& data) = 0;
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -49,7 +49,7 @@
/*!
* @if jp
- * @brief ÀßÄê½é´ü²½
+ * @brief ÀßÄEé´E½
* @else
* @brief Initializing configuration
* @endif
@@ -66,7 +66,8 @@
* @brief Write data into the buffer
* @endif
*/
- InPortConsumer::ReturnCode InPortCorbaCdrConsumer::put(const cdrMemoryStream& data)
+ InPortConsumer::ReturnCode InPortCorbaCdrConsumer::
+ put(cdrMemoryStream& data)
{
RTC_PARANOID(("put()"));
@@ -114,8 +115,7 @@
/*!
* @if jp
- * @brief InterfaceProfile¾ðÊó¤ò¸ø³«¤¹¤ë
- * @else
+ * @brief InterfaceProfile¾ðÊó¤ò¸ø³«¤¹¤E * @else
* @brief Publish InterfaceProfile information
* @endif
*/
@@ -149,8 +149,7 @@
/*!
* @if jp
- * @brief ¥Ç¡¼¥¿Á÷¿®ÄÌÃΤ«¤é¤ÎÅÐÏ¿²ò½ü
- * @else
+ * @brief ¥Ç¡¼¥¿Á÷¿®ÄÌÃΤ«¤é¤ÎÅÐÏ¿²ò½E * @else
* @brief Unsubscribe the data send notification
* @endif
*/
@@ -169,8 +168,7 @@
/*!
* @if jp
- * @brief IORʸ»úÎ󤫤饪¥Ö¥¸¥§¥¯¥È»²¾È¤ò¼èÆÀ¤¹¤ë
- * @else
+ * @brief IORʸ»úÎ󤫤饪¥Ö¥¸¥§¥¯¥È»²¾È¤ò¼èÆÀ¤¹¤E * @else
* @brief Getting object reference fromn IOR string
* @endif
*/
@@ -214,8 +212,7 @@
/*!
* @if jp
- * @brief Any¤«¤éľÀÜ¥ª¥Ö¥¸¥§¥¯¥È»²¾È¤ò¼èÆÀ¤¹¤ë
- * @else
+ * @brief Any¤«¤éľÀÜ¥ª¥Ö¥¸¥§¥¯¥È»²¾È¤ò¼èÆÀ¤¹¤E * @else
* @brief Getting object reference fromn Any directry
* @endif
*/
@@ -259,7 +256,7 @@
/*!
* @if jp
- * @brief Àܳ²ò½ü(IORÈÇ)
+ * @brief Àܳ²ò½EIORÈÇ)
* @else
* @brief ubsubscribing (IOR version)
* @endif
@@ -298,7 +295,7 @@
/*!
* @if jp
- * @brief Àܳ²ò½ü(Object referenceÈÇ)
+ * @brief Àܳ²ò½EObject referenceÈÇ)
* @else
* @brief ubsubscribing (Object reference version)
* @endif
@@ -330,7 +327,7 @@
/*!
* @if jp
- * @brief ¥ê¥¿¡¼¥ó¥³¡¼¥ÉÊÑ´¹
+ * @brief ¥E¿¡¼¥ó¥³¡¼¥ÉÊÑ´¹
* @else
* @brief Return codes conversion
* @endif
@@ -368,8 +365,7 @@
{
/*!
* @if jp
- * @brief ¥â¥¸¥å¡¼¥ë½é´ü²½´Ø¿ô
- * @else
+ * @brief ¥â¥¸¥å¡¼¥Eé´E½´Ø¿E * @else
* @brief Module initialization
* @endif
*/
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -155,7 +155,7 @@
*
* @endif
*/
- virtual ReturnCode put(const cdrMemoryStream& data);
+ virtual ReturnCode put(cdrMemoryStream& data);
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -206,7 +206,7 @@
*/
::OpenRTM::PortStatus
InPortCorbaCdrProvider::convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
switch(status)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -257,7 +257,7 @@
*/
::OpenRTM::PortStatus
convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
@@ -269,7 +269,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWrite(const cdrMemoryStream& data)
+ inline void onBufferWrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE].notify(m_profile, data);
@@ -284,7 +284,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferFull(const cdrMemoryStream& data)
+ inline void onBufferFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_FULL].notify(m_profile, data);
@@ -299,7 +299,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWriteTimeout(const cdrMemoryStream& data)
+ inline void onBufferWriteTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE_TIMEOUT].notify(m_profile, data);
@@ -314,7 +314,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWriteOverwrite(const cdrMemoryStream& data)
+ inline void onBufferWriteOverwrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_OVERWRITE].notify(m_profile, data);
@@ -329,7 +329,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
@@ -344,7 +344,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverFull(const cdrMemoryStream& data)
+ inline void onReceiverFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
@@ -357,7 +357,7 @@
* @brief Notify an ON_RECEIVER_TIMEOUT event to listeners
* @endif
*/
- inline void onReceiverTimeout(const cdrMemoryStream& data)
+ inline void onReceiverTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_TIMEOUT].notify(m_profile, data);
@@ -370,7 +370,7 @@
* @Brief Notify an ON_RECEIVER_ERROR event to listeners
* @endif
*/
- inline void onReceiverError(const cdrMemoryStream& data)
+ inline void onReceiverError(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_ERROR].notify(m_profile, data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -49,7 +49,7 @@
/*!
* @if jp
- * @brief ÀßÄê½é´ü²½
+ * @brief ÀßÄEé´E½
* @else
* @brief Initializing configuration
* @endif
@@ -66,7 +66,8 @@
* @brief Write data into the buffer
* @endif
*/
- InPortConsumer::ReturnCode InPortDirectConsumer::put(const cdrMemoryStream& data)
+ InPortConsumer::ReturnCode InPortDirectConsumer::
+ put(cdrMemoryStream& data)
{
RTC_PARANOID(("put(): never called."));
return UNKNOWN_ERROR;
@@ -74,8 +75,7 @@
/*!
* @if jp
- * @brief InterfaceProfile¾ðÊó¤ò¸ø³«¤¹¤ë
- * @else
+ * @brief InterfaceProfile¾ðÊó¤ò¸ø³«¤¹¤E * @else
* @brief Publish InterfaceProfile information
* @endif
*/
@@ -101,8 +101,7 @@
/*!
* @if jp
- * @brief ¥Ç¡¼¥¿Á÷¿®ÄÌÃΤ«¤é¤ÎÅÐÏ¿²ò½ü
- * @else
+ * @brief ¥Ç¡¼¥¿Á÷¿®ÄÌÃΤ«¤é¤ÎÅÐÏ¿²ò½E * @else
* @brief Unsubscribe the data send notification
* @endif
*/
@@ -117,8 +116,7 @@
{
/*!
* @if jp
- * @brief ¥â¥¸¥å¡¼¥ë½é´ü²½´Ø¿ô
- * @else
+ * @brief ¥â¥¸¥å¡¼¥Eé´E½´Ø¿E * @else
* @brief Module initialization
* @endif
*/
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -154,7 +154,7 @@
*
* @endif
*/
- virtual ReturnCode put(const cdrMemoryStream& data);
+ virtual ReturnCode put(cdrMemoryStream& data);
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortDirectProvider.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortDirectProvider.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortDirectProvider.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -234,7 +234,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWrite(const cdrMemoryStream& data)
+ inline void onBufferWrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE].notify(m_profile, data);
@@ -249,7 +249,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferFull(const cdrMemoryStream& data)
+ inline void onBufferFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_FULL].notify(m_profile, data);
@@ -264,7 +264,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWriteTimeout(const cdrMemoryStream& data)
+ inline void onBufferWriteTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE_TIMEOUT].notify(m_profile, data);
@@ -279,7 +279,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWriteOverwrite(const cdrMemoryStream& data)
+ inline void onBufferWriteOverwrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_OVERWRITE].notify(m_profile, data);
@@ -294,7 +294,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
@@ -309,7 +309,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverFull(const cdrMemoryStream& data)
+ inline void onReceiverFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
@@ -322,7 +322,7 @@
* @brief Notify an ON_RECEIVER_TIMEOUT event to listeners
* @endif
*/
- inline void onReceiverTimeout(const cdrMemoryStream& data)
+ inline void onReceiverTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_TIMEOUT].notify(m_profile, data);
@@ -335,7 +335,7 @@
* @Brief Notify an ON_RECEIVER_ERROR event to listeners
* @endif
*/
- inline void onReceiverError(const cdrMemoryStream& data)
+ inline void onReceiverError(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_ERROR].notify(m_profile, data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -93,12 +93,15 @@
switch (ret)
{
case BufferStatus::BUFFER_OK:
+ onBufferRead(data);
return PORT_OK;
break;
case BufferStatus::BUFFER_EMPTY:
+ onBufferEmpty(data);
return BUFFER_EMPTY;
break;
case BufferStatus::TIMEOUT:
+ onBufferReadTimeout(data);
return BUFFER_TIMEOUT;
break;
case BufferStatus::PRECONDITION_NOT_MET:
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortPushConnector.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -271,7 +271,25 @@
* @endif
*/
void onDisconnect();
+
+ inline void onBufferRead(cdrMemoryStream& data)
+ {
+ m_listeners.
+ connectorData_[ON_BUFFER_READ].notify(m_profile, data);
+ }
+ void onBufferEmpty(cdrMemoryStream& data)
+ {
+ m_listeners.
+ connectorData_[ON_BUFFER_EMPTY].notify(m_profile, data);
+
+ }
+ void onBufferReadTimeout(cdrMemoryStream& data)
+ {
+ m_listeners.
+ connectorData_[ON_BUFFER_READ_TIMEOUT].notify(m_profile, data);
+ }
+
private:
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Makefile.am 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/Makefile.am 2017-12-10 22:41:30 UTC (rev 3117)
@@ -177,6 +177,7 @@
SdoServiceConsumerBase.h \
StateMachine.h \
Typename.h \
+ Timestamp.h \
LocalServiceBase.h \
LogstreamBase.h \
ListenerHolder.h \
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPort.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPort.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -144,6 +144,11 @@
m_propValueIndex = NVUtil::find_index(m_profile.properties,
"dataport.data_value");
}
+ this->addConnectorDataListener(ON_BUFFER_WRITE,
+ new Timestamp<DataType>("on_write"));
+ this->addConnectorDataListener(ON_SEND,
+ new Timestamp<DataType>("on_send"));
+
}
/*!
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -159,7 +159,7 @@
*
* @endif
*/
- virtual ReturnCode write(const cdrMemoryStream& data) = 0;
+ virtual ReturnCode write(cdrMemoryStream& data) = 0;
/*!
* @if jp
@@ -226,7 +226,7 @@
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
m_inPortListeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
- RTC_PARANOID(("ONBUFFER_OVERWRITE(InPort,OutPort), "
+ RTC_PARANOID(("ON_BUFFER_OVERWRITE(InPort,OutPort), "
"ON_RECEIVER_FULL(InPort,OutPort) "
"callback called in direct mode."));
}
@@ -283,7 +283,7 @@
* @if jp
* @brief ¥í¥¬¡¼¥¹¥È¥ê¡¼¥à
* @else
- * @brief Logger stream
+ * @brief Logger streamf
* @endif
*/
Logger rtclog;
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -230,7 +230,7 @@
*/
OutPortConsumer::ReturnCode
OutPortCorbaCdrConsumer::convertReturn(::OpenRTM::PortStatus status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
switch(status)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -267,7 +267,7 @@
* @endif
*/
OutPortConsumer::ReturnCode convertReturn(::OpenRTM::PortStatus status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
* @if jp
@@ -278,7 +278,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWrite(const cdrMemoryStream& data)
+ inline void onBufferWrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE].notify(m_profile, data);
@@ -293,7 +293,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferFull(const cdrMemoryStream& data)
+ inline void onBufferFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_FULL].notify(m_profile, data);
@@ -308,7 +308,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
@@ -323,7 +323,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverFull(const cdrMemoryStream& data)
+ inline void onReceiverFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -220,7 +220,7 @@
*/
::OpenRTM::PortStatus
OutPortCorbaCdrProvider::convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
switch(status)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -253,7 +253,7 @@
* @endif
*/
::OpenRTM::PortStatus convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
@@ -265,7 +265,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferRead(const cdrMemoryStream& data)
+ inline void onBufferRead(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_READ].notify(m_profile, data);
@@ -280,7 +280,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onSend(const cdrMemoryStream& data)
+ inline void onSend(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_SEND].notify(m_profile, data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -76,7 +76,7 @@
* @endif
*/
ConnectorBase::ReturnCode
- OutPortPullConnector::write(const cdrMemoryStream& data)
+ OutPortPullConnector::write(cdrMemoryStream& data)
{
m_buffer->write(data);
return PORT_OK;
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -162,7 +162,7 @@
*
* @endif
*/
- virtual ReturnCode write(const cdrMemoryStream& data);
+ virtual ReturnCode write(cdrMemoryStream& data);
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -83,7 +83,7 @@
* @endif
*/
ConnectorBase::ReturnCode
- OutPortPushConnector::write(const cdrMemoryStream& data)
+ OutPortPushConnector::write(cdrMemoryStream& data)
{
RTC_TRACE(("write()"));
#ifdef ORB_IS_ORBEXPRESS
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -189,7 +189,7 @@
*
* @endif
*/
- virtual ReturnCode write(const cdrMemoryStream& data);
+ virtual ReturnCode write(cdrMemoryStream& data);
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherBase.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherBase.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherBase.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -253,7 +253,7 @@
*
* @endif
*/
- virtual ReturnCode write(const cdrMemoryStream& data,
+ virtual ReturnCode write(cdrMemoryStream& data,
unsigned long sec,
unsigned long usec) = 0;
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -35,8 +35,7 @@
*/
PublisherFlush::PublisherFlush()
: rtclog("PublisherFlush"),
- m_consumer(0), m_listeners(0), m_active(false),
- m_retcode(PORT_OK)
+ m_consumer(0), m_listeners(0), m_retcode(PORT_OK), m_active(false)
{
}
@@ -133,7 +132,7 @@
* @brief Write data
* @endif
*/
- PublisherBase::ReturnCode PublisherFlush::write(const cdrMemoryStream& data,
+ PublisherBase::ReturnCode PublisherFlush::write(cdrMemoryStream& data,
unsigned long sec,
unsigned long usec)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -265,7 +265,7 @@
*
* @endif
*/
- virtual ReturnCode write(const cdrMemoryStream& data,
+ virtual ReturnCode write(cdrMemoryStream& data,
unsigned long sec,
unsigned long usec);
/*!
@@ -361,7 +361,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onSend(const cdrMemoryStream& data)
+ inline void onSend(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_SEND].notify(m_profile, data);
@@ -376,7 +376,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
@@ -391,7 +391,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverFull(const cdrMemoryStream& data)
+ inline void onReceiverFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
@@ -406,7 +406,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverTimeout(const cdrMemoryStream& data)
+ inline void onReceiverTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_TIMEOUT].notify(m_profile, data);
@@ -421,7 +421,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverError(const cdrMemoryStream& data)
+ inline void onReceiverError(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_ERROR].notify(m_profile, data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -162,7 +162,7 @@
* @brief Write data
* @endif
*/
- PublisherBase::ReturnCode PublisherNew::write(const cdrMemoryStream& data,
+ PublisherBase::ReturnCode PublisherNew::write(cdrMemoryStream& data,
unsigned long sec,
unsigned long usec)
{
@@ -424,7 +424,7 @@
{
m_buffer->advanceRptr(postskip);
- const cdrMemoryStream& cdr(m_buffer->get());
+ cdrMemoryStream& cdr(m_buffer->get());
onBufferRead(cdr);
@@ -493,7 +493,7 @@
*/
PublisherBase::ReturnCode
PublisherNew::convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
/*
* BufferStatus -> DataPortStatus
@@ -541,7 +541,7 @@
*/
PublisherNew::ReturnCode
PublisherNew::invokeListener(DataPortStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
// ret:
// PORT_OK, PORT_ERROR, SEND_FULL, SEND_TIMEOUT, CONNECTION_LOST,
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -323,7 +323,7 @@
*
* @endif
*/
- virtual ReturnCode write(const cdrMemoryStream& data,
+ virtual ReturnCode write(cdrMemoryStream& data,
unsigned long sec,
unsigned long usec);
@@ -529,7 +529,7 @@
* @endif
*/
ReturnCode convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
* @if jp
@@ -549,7 +549,7 @@
* @endif
*/
ReturnCode invokeListener(DataPortStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
* @if jp
@@ -560,7 +560,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWrite(const cdrMemoryStream& data)
+ inline void onBufferWrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE].notify(m_profile, data);
@@ -575,7 +575,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferFull(const cdrMemoryStream& data)
+ inline void onBufferFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_FULL].notify(m_profile, data);
@@ -590,7 +590,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWriteTimeout(const cdrMemoryStream& data)
+ inline void onBufferWriteTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE_TIMEOUT].notify(m_profile, data);
@@ -605,7 +605,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWriteOverwrite(const cdrMemoryStream& data)
+ inline void onBufferWriteOverwrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_OVERWRITE].notify(m_profile, data);
@@ -620,7 +620,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferRead(const cdrMemoryStream& data)
+ inline void onBufferRead(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_READ].notify(m_profile, data);
@@ -635,7 +635,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onSend(const cdrMemoryStream& data)
+ inline void onSend(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_SEND].notify(m_profile, data);
@@ -650,7 +650,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
@@ -665,7 +665,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverFull(const cdrMemoryStream& data)
+ inline void onReceiverFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
@@ -680,7 +680,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverTimeout(const cdrMemoryStream& data)
+ inline void onReceiverTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_TIMEOUT].notify(m_profile, data);
@@ -695,7 +695,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverError(const cdrMemoryStream& data)
+ inline void onReceiverError(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_ERROR].notify(m_profile, data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.cpp 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.cpp 2017-12-10 22:41:30 UTC (rev 3117)
@@ -170,7 +170,7 @@
* @endif
*/
PublisherBase::ReturnCode
- PublisherPeriodic::write(const cdrMemoryStream& data,
+ PublisherPeriodic::write(cdrMemoryStream& data,
unsigned long sec,
unsigned long usec)
{
@@ -284,7 +284,7 @@
while (m_buffer->readable() > 0)
{
- const cdrMemoryStream& cdr(m_buffer->get());
+ cdrMemoryStream& cdr(m_buffer->get());
onBufferRead(cdr);
onSend(cdr);
@@ -310,7 +310,7 @@
RTC_TRACE(("pushFifo()"));
if (bufferIsEmpty()) { return BUFFER_EMPTY; }
- const cdrMemoryStream& cdr(m_buffer->get());
+ cdrMemoryStream& cdr(m_buffer->get());
onBufferRead(cdr);
onSend(cdr);
@@ -345,7 +345,7 @@
{
m_buffer->advanceRptr(postskip);
readable -= postskip;
- const cdrMemoryStream& cdr(m_buffer->get());
+ cdrMemoryStream& cdr(m_buffer->get());
onBufferRead(cdr);
onSend(cdr);
@@ -380,7 +380,7 @@
m_readback = true;
m_buffer->advanceRptr(m_buffer->readable() - 1);
- const cdrMemoryStream& cdr(m_buffer->get());
+ cdrMemoryStream& cdr(m_buffer->get());
onBufferRead(cdr);
@@ -514,7 +514,7 @@
*/
PublisherBase::ReturnCode
PublisherPeriodic::convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
/*
* BufferStatus -> DataPortStatus
@@ -562,7 +562,7 @@
*/
PublisherPeriodic::ReturnCode
PublisherPeriodic::invokeListener(DataPortStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
// ret:
// PORT_OK, PORT_ERROR, SEND_FULL, SEND_TIMEOUT, CONNECTION_LOST,
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.h 2017-12-10 21:20:20 UTC (rev 3116)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -323,7 +323,7 @@
*
* @endif
*/
- virtual ReturnCode write(const cdrMemoryStream& data,
+ virtual ReturnCode write(cdrMemoryStream& data,
unsigned long sec,
unsigned long usec);
/*!
@@ -527,7 +527,7 @@
* @endif
*/
ReturnCode convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
@@ -548,7 +548,7 @@
* @endif
*/
ReturnCode invokeListener(DataPortStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
* @if jp
@@ -559,7 +559,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWrite(const cdrMemoryStream& data)
+ inline void onBufferWrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE].notify(m_profile, data);
@@ -574,7 +574,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferFull(const cdrMemoryStream& data)
+ inline void onBufferFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_FULL].notify(m_profile, data);
@@ -589,7 +589,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferWriteTimeout(const cdrMemoryStream& data)
+ inline void onBufferWriteTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE_TIMEOUT].notify(m_profile, data);
@@ -604,7 +604,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onBufferRead(const cdrMemoryStream& data)
+ inline void onBufferRead(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_READ].notify(m_profile, data);
@@ -619,7 +619,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onSend(const cdrMemoryStream& data)
+ inline void onSend(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_SEND].notify(m_profile, data);
@@ -634,7 +634,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
@@ -649,7 +649,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverFull(const cdrMemoryStream& data)
+ inline void onReceiverFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
@@ -664,7 +664,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverTimeout(const cdrMemoryStream& data)
+ inline void onReceiverTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_TIMEOUT].notify(m_profile, data);
@@ -679,7 +679,7 @@
* @param data cdrMemoryStream
* @endif
*/
- inline void onReceiverError(const cdrMemoryStream& data)
+ inline void onReceiverError(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_ERROR].notify(m_profile, data);
Copied: trunk/OpenRTM-aist/src/lib/rtm/Timestamp.h (from rev 2880, branches/FSM4RTC/OpenRTM-aist/src/lib/rtm/Timestamp.h)
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Timestamp.h (rev 0)
+++ trunk/OpenRTM-aist/src/lib/rtm/Timestamp.h 2017-12-10 22:41:30 UTC (rev 3117)
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+/*!
+ * @file Timestamp.h
+ * @brief Timestamp listener class
+ * @date $Date$
+ * @author Noriaki Ando <n-ando at aist.go.jp>
+ *
+ * Copyright (C) 2017
+ * Noriaki Ando
+ * National Institute of
+ * Advanced Industrial Science and Technology (AIST), Japan
+ * All rights reserved.
+ *
+ * $Id$
+ *
+ */
+
+#ifndef RTM_TIMESTAMP_H
+#define RTM_TIMESTAMP_H
+
+#include <rtm/ConnectorListener.h>
+
+namespace RTC
+{
+ template <class DataType>
+ class Timestamp
+ : public ConnectorDataListenerT<DataType>
+ {
+ USE_CONNLISTENER_STATUS;
+ public:
+ Timestamp(const char* ts_type) : m_tstype(ts_type) {}
+ virtual ~Timestamp() {}
+ virtual ReturnCode operator()(ConnectorInfo& info, DataType& data)
+ {
+ if (info.properties["timestamp_policy"] != m_tstype)
+ {
+ return NO_CHANGE;
+ }
+ coil::TimeValue tm(coil::gettimeofday());
+ data.tm.sec = tm.sec();
+ data.tm.nsec = tm.usec() * 1000;
+ return DATA_CHANGED;
+ }
+ std::string m_tstype;
+ };
+}; // End of namesepace RTM
+
+#endif // RTM_TIMESTAMP_H
More information about the openrtm-commit
mailing list