[openrtm-commit:02993] r3127 - trunk/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 12月 11日 (月) 16:37:18 JST
Author: miyamoto
Date: 2017-12-11 16:37:17 +0900 (Mon, 11 Dec 2017)
New Revision: 3127
Modified:
trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt
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/InPortDirectConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/InPortSHMConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortSHMConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.h
trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp
trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.h
Log:
[compat] refs #4391
Modified: trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt 2017-12-11 07:37:17 UTC (rev 3127)
@@ -256,6 +256,7 @@
OutPortSHMConsumer.h
OutPortSHMProvider.h
SharedMemoryPort.h
+ Timestamp.h
${PROJECT_BINARY_DIR}/config_rtc.h
${PROJECT_BINARY_DIR}/version.h
)
Modified: trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.cpp 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -111,8 +111,8 @@
}
ConnectorDataListenerHolder::ReturnCode
- ConnectorDataListenerHolder::notify(const ConnectorInfo& info,
- const cdrMemoryStream& cdrdata)
+ ConnectorDataListenerHolder::notify(ConnectorInfo& info,
+ cdrMemoryStream& cdrdata)
{
Guard guard(m_mutex);
ConnectorListenerHolder::ReturnCode ret(NO_CHANGE);
@@ -183,7 +183,7 @@
}
ConnectorListenerHolder::ReturnCode
- ConnectorListenerHolder::notify(const ConnectorInfo& info)
+ ConnectorListenerHolder::notify(ConnectorInfo& info)
{
Guard guard(m_mutex);
ConnectorListenerHolder::ReturnCode ret;
Modified: trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -471,8 +471,8 @@
*
* @endif
*/
- virtual ReturnCode operator()(const ConnectorInfo& info,
- const cdrMemoryStream& data) = 0;
+ virtual ReturnCode operator()(ConnectorInfo& info,
+ cdrMemoryStream& data) = 0;
};
/*!
@@ -538,8 +538,8 @@
*
* @endif
*/
- virtual ReturnCode operator()(const ConnectorInfo& info,
- const cdrMemoryStream& cdrdata)
+ virtual ReturnCode operator()(ConnectorInfo& info,
+ cdrMemoryStream& cdrdata)
{
DataType data;
#ifdef ORB_IS_ORBEXPRESS
@@ -583,8 +583,18 @@
ReturnCode ret = this->operator()(info, data);
if (ret == DATA_CHANGED || ret == BOTH_CHANGED)
{
+
+#ifdef ORB_IS_ORBEXPRESS
+ cdrdata.cdr.rewind();
+ cdrdata.cdr >> data;
+#elif defined(ORB_IS_TAO)
+ cdrdata.cdr.reset();
+ TAO_InputCDR tao_cdr = TAO_InputCDR(cdrdata.cdr);
+ tao_cdr >> data;
+#else
cdrdata.rewindPtrs();
data >>= cdrdata;
+#endif
}
return ret;
}
@@ -606,8 +616,8 @@
*
* @endif
*/
- virtual ReturnCode operator()(const ConnectorInfo& info,
- const DataType& data) = 0;
+ virtual ReturnCode operator()(ConnectorInfo& info,
+ DataType& data) = 0;
};
/*!
@@ -919,7 +929,7 @@
*
* @endif
*/
- virtual ReturnCode operator()(const ConnectorInfo& info) = 0;
+ virtual ReturnCode operator()(ConnectorInfo& info) = 0;
};
@@ -1042,8 +1052,8 @@
* @param cdrdata Data
* @endif
*/
- ReturnCode notify(const ConnectorInfo& info,
- const cdrMemoryStream& cdrdata);
+ ReturnCode notify(ConnectorInfo& info,
+ cdrMemoryStream& cdrdata);
/*!
* @if jp
@@ -1067,10 +1077,10 @@
* @endif
*/
template <class DataType>
- ReturnCode notify(const ConnectorInfo& info, const DataType& typeddata)
+ ReturnCode notify(ConnectorInfo& info, DataType& typeddata)
{
- Guard guard(m_mutex);
- ReturnCode ret(NO_CHANGE);
+ Guard guard(m_mutex);
+ ReturnCode ret(NO_CHANGE);
for (int i(0), len(m_listeners.size()); i < len; ++i)
{
ConnectorDataListenerT<DataType>* listener(0);
@@ -1078,10 +1088,23 @@
dynamic_cast<ConnectorDataListenerT<DataType>*>(m_listeners[i].first);
if (listener != 0)
{
- listener->operator()(info, typeddata);
+ ret = ret | listener->operator()(info, typeddata);
}
+ else
+ {
+ cdrMemoryStream cdr;
+#ifdef ORB_IS_ORBEXPRESS
+ cdr.cdr >> typeddata;
+#elif defined(ORB_IS_TAO)
+ TAO_InputCDR tao_cdr = TAO_InputCDR(cdr.cdr);
+ tao_cdr >> typeddata;
+#else
+ typeddata >>= cdr;
+#endif
+ ret = ret | m_listeners[i].first->operator()(info, cdr);
+ }
}
- return ret;
+ return ret;
}
private:
@@ -1208,7 +1231,7 @@
* @param info ConnectonotifyrInfo
* @endif
*/
- ReturnCode notify(const ConnectorInfo& info);
+ ReturnCode notify(ConnectorInfo& info);
private:
std::vector<Entry> m_listeners;
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -318,7 +318,7 @@
return false;
}
- virtual void write(const DataType& data)
+ virtual void write(DataType& data)
{
Guard guard(m_valueMutex);
m_value = data;
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -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-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -67,7 +67,7 @@
* @endif
*/
InPortConsumer::ReturnCode InPortCorbaCdrConsumer::
- put(const cdrMemoryStream& data)
+ put(cdrMemoryStream& data)
{
RTC_PARANOID(("put()"));
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -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/InPortDirectConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -67,7 +67,7 @@
* @endif
*/
InPortConsumer::ReturnCode InPortDirectConsumer::
- put(const cdrMemoryStream& data)
+ put(cdrMemoryStream& data)
{
RTC_PARANOID(("put(): never called."));
return UNKNOWN_ERROR;
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -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/InPortSHMConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortSHMConsumer.cpp 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortSHMConsumer.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -116,7 +116,7 @@
* @brief Write data into the buffer
* @endif
*/
- InPortConsumer::ReturnCode InPortSHMConsumer::put(const cdrMemoryStream& data)
+ InPortConsumer::ReturnCode InPortSHMConsumer::put(cdrMemoryStream& data)
{
RTC_PARANOID(("put()"));
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortSHMConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortSHMConsumer.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortSHMConsumer.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -53,7 +53,7 @@
* @endif
*/
class InPortSHMConsumer
- : public InPortConsumer,
+ : public InPortConsumer,
public CorbaConsumer< ::OpenRTM::PortSharedMemory >
{
typedef coil::Guard<coil::Mutex> Guard;
@@ -130,7 +130,7 @@
*
* @endif
*/
- virtual InPortConsumer::ReturnCode put(const cdrMemoryStream& data);
+ virtual InPortConsumer::ReturnCode put(cdrMemoryStream& data);
/*!
* @if jp
* @brief
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -166,7 +166,7 @@
*/
::OpenRTM::PortStatus
InPortSHMProvider::convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
switch(status)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -145,22 +145,22 @@
*/
virtual void setListener(ConnectorInfo& info,
ConnectorListeners* listeners);
- /*!
- * @if jp
- * @brief Connectorを設定する。
- *
- *
- *
- * @param connector OutPortConnector
- *
- * @else
- * @brief set Connector
- *
- *
- *
- * @param connector OutPortConnector
- *
- * @endif
+ /*!
+ * @if jp
+ * @brief Connectorを設定する。
+ *
+ *
+ *
+ * @param connector OutPortConnector
+ *
+ * @else
+ * @brief set Connector
+ *
+ *
+ *
+ * @param connector OutPortConnector
+ *
+ * @endif
*/
virtual void setConnector(InPortConnector* connector);
@@ -188,52 +188,52 @@
::OpenRTM::PortStatus
convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
- inline void onBufferWrite(const cdrMemoryStream& data)
+ inline void onBufferWrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE].notify(m_profile, data);
}
- inline void onBufferFull(const cdrMemoryStream& data)
+ inline void onBufferFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_FULL].notify(m_profile, data);
}
- inline void onBufferWriteTimeout(const cdrMemoryStream& data)
+ inline void onBufferWriteTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_WRITE_TIMEOUT].notify(m_profile, data);
}
- inline void onBufferWriteOverwrite(const cdrMemoryStream& data)
+ inline void onBufferWriteOverwrite(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_BUFFER_OVERWRITE].notify(m_profile, data);
}
- inline void onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
}
- inline void onReceiverFull(const cdrMemoryStream& data)
+ inline void onReceiverFull(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_FULL].notify(m_profile, data);
}
- inline void onReceiverTimeout(const cdrMemoryStream& data)
+ inline void onReceiverTimeout(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVER_TIMEOUT].notify(m_profile, data);
}
- 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/OutPortConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -209,7 +209,7 @@
* @endif
*/
template <class DataType>
- ReturnCode write(const DataType& data)
+ ReturnCode write(DataType& data)
{
if (m_directInPort != NULL)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -257,7 +257,7 @@
*/
OutPortConsumer::ReturnCode
OutPortSHMConsumer::convertReturn(::OpenRTM::PortStatus status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
switch(status)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -223,7 +223,7 @@
* @endif
*/
OutPortConsumer::ReturnCode convertReturn(::OpenRTM::PortStatus status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
* @if jp
@@ -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 onReceived(const cdrMemoryStream& data)
+ inline void onReceived(cdrMemoryStream& data)
{
m_listeners->
connectorData_[ON_RECEIVED].notify(m_profile, data);
@@ -279,7 +279,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);
@@ -333,8 +333,8 @@
int m_memory_size;
bool m_endian;
- CdrBufferBase* m_buffer;
- ConnectorListeners* m_listeners;
+ CdrBufferBase* m_buffer;
+ ConnectorListeners* m_listeners;
ConnectorInfo m_profile;
};
}; // namespace RTC
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -205,7 +205,7 @@
*/
::OpenRTM::PortStatus
OutPortSHMProvider::convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data)
+ cdrMemoryStream& data)
{
switch(status)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -197,7 +197,7 @@
* @endif
*/
::OpenRTM::PortStatus convertReturn(BufferStatus::Enum status,
- const cdrMemoryStream& data);
+ cdrMemoryStream& data);
/*!
@@ -209,7 +209,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);
@@ -224,7 +224,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/SharedMemoryPort.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp 2017-12-11 07:37:17 UTC (rev 3127)
@@ -248,7 +248,7 @@
*
* @endif
*/
- void SharedMemoryPort::write(const cdrMemoryStream& data)
+ void SharedMemoryPort::write(cdrMemoryStream& data)
{
#ifdef ORB_IS_ORBEXPRESS
CORBA::ULongLong data_size = (CORBA::ULongLong)data.cdr.size_written();
Modified: trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.h 2017-12-11 06:13:10 UTC (rev 3126)
+++ trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.h 2017-12-11 07:37:17 UTC (rev 3127)
@@ -177,7 +177,7 @@
*
* @endif
*/
- virtual void write(const cdrMemoryStream& data);
+ virtual void write(cdrMemoryStream& data);
/*!
* @if jp
* @brief データを読み込む
More information about the openrtm-commit
mailing list