[openrtm-commit:03151] r3209 - in trunk/OpenRTM-aist: . src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 1月 28日 (日) 20:34:31 JST
Author: miyamoto
Date: 2018-01-28 20:34:31 +0900 (Sun, 28 Jan 2018)
New Revision: 3209
Modified:
trunk/OpenRTM-aist/CMakeLists.txt
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/RTC.h
trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp
Log:
[incompat, bugfix, TAO] fixed bug.
Modified: trunk/OpenRTM-aist/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/CMakeLists.txt 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/CMakeLists.txt 2018-01-28 11:34:31 UTC (rev 3209)
@@ -219,7 +219,7 @@
set(ORB_LINK_DIR ${ORB_ROOT}/lib)
set(ORB_LIBRARIES optimized;ACE;optimized;TAO;optimized;TAO_AnyTypeCode;optimized;TAO_PortableServer;optimized;TAO_Svc_Utils;optimized;TAO_CosNaming;optimized;TAO_IORTable;optimized;TAO_CodecFactory;optimized;TAO_PI;optimized;TAO_Utils;optimized;TAO_Strategies;debug;ACEd;debug;TAOd;debug;TAO_AnyTypeCoded;debug;TAO_PortableServerd;debug;TAO_Svc_Utilsd;debug;TAO_CosNamingd;debug;TAO_IORTabled;debug;TAO_CodecFactoryd;debug;TAO_PId;debug;TAO_Utilsd;debug;TAO_Strategiesd;iphlpapi)
set(ORB_INCLUDE_DIR ${ORB_ROOT} ${ORB_ROOT}/TAO ${ORB_ROOT}/TAO/orbsvcs)
- SET(ORB_C_FLAGS_LIST ${ORB_C_FLAGS_LIST} -D_WINSOCKAPI_ -DWITH_ACE -DACE_LACKS_CDR_ALIGNMENT)
+ SET(ORB_C_FLAGS_LIST ${ORB_C_FLAGS_LIST} -D_WINSOCKAPI_ -DWITH_ACE)
endif()
ADD_DEFINITIONS(${ORB_C_FLAGS_LIST})
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -85,9 +85,8 @@
//::OpenRTM::CdrData tmp(data_tmp.size_written(), data_tmp.size_written(),
// to, 0);
#elif defined(ORB_IS_TAO)
- char *c = const_cast<char*>(data.cdr.buffer());
- ::OpenRTM::CdrData tmp(data.cdr.length(), data.cdr.length(),
- reinterpret_cast<CORBA::Octet*>(c), 0);
+ ::OpenRTM::CdrData tmp;
+ data.encodeCDRData(tmp);
#else
::OpenRTM::CdrData tmp(data.bufSize(), data.bufSize(),
static_cast<CORBA::Octet*>(data.bufPtr()), 0);
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -161,7 +161,7 @@
#ifdef ORB_IS_ORBEXPRESS
cdr.cdr.write_array_1(data.get_buffer(), data.length());
#elif defined(ORB_IS_TAO)
- cdr.cdr.write_octet_array(data.get_buffer(), data.length());
+ cdr.decodeCDRData(data);
#else
cdr.put_octet_array(&(data[0]), data.length());
#endif
@@ -182,8 +182,9 @@
RTC_PARANOID(("converted CDR data size: %d", cdr.size_written()));
#elif defined(ORB_IS_TAO)
//cdr.setByteSwapFlag(endian_type);
- cdr.cdr.write_octet_array(data.get_buffer(), data.length());
- RTC_PARANOID(("converted CDR data size: %d", cdr.cdr.length()));
+ cdr.decodeCDRData(data);
+
+ RTC_PARANOID(("converted CDR data size: %d", cdr.cdr.total_length()));
#else
cdr.setByteSwapFlag(endian_type);
cdr.put_octet_array(&(data[0]), data.length());
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPConsumer.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPConsumer.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -91,9 +91,8 @@
//::OpenRTM::CdrData tmp(data_tmp.size_written(), data_tmp.size_written(),
// to, 0);
#elif defined(ORB_IS_TAO)
- char *c = const_cast<char*>(data.cdr.buffer());
- ::OpenRTM::CdrData tmp(data.cdr.length(), data.cdr.length(),
- reinterpret_cast<CORBA::Octet*>(c), 0);
+ ::OpenRTM::CdrData tmp;
+ data.encodeCDRData(tmp);
#else
::OpenRTM::CdrData tmp(data.bufSize(), data.bufSize(),
static_cast<CORBA::Octet*>(data.bufPtr()), 0);
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPProvider.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrUDPProvider.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -161,7 +161,7 @@
#ifdef ORB_IS_ORBEXPRESS
cdr.cdr.write_array_1(data.get_buffer(), data.length());
#elif defined(ORB_IS_TAO)
- cdr.cdr.write_octet_array(data.get_buffer(), data.length());
+ cdr.decodeCDRData(data);
#else
cdr.put_octet_array(&(data[0]), data.length());
#endif
@@ -182,8 +182,8 @@
RTC_PARANOID(("converted CDR data size: %d", cdr.size_written()));
#elif defined(ORB_IS_TAO)
//cdr.setByteSwapFlag(endian_type);
- cdr.cdr.write_octet_array(data.get_buffer(), data.length());
- RTC_PARANOID(("converted CDR data size: %d", cdr.cdr.length()));
+ cdr.decodeCDRData(data);
+ RTC_PARANOID(("converted CDR data size: %d", cdr.cdr.total_length()));
#else
cdr.setByteSwapFlag(endian_type);
cdr.put_octet_array(&(data[0]), data.length());
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortSHMProvider.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -139,7 +139,7 @@
#ifdef ORB_IS_ORBEXPRESS
RTC_PARANOID(("received data size: %d", cdr.cdr.size_written()));
#elif defined(ORB_IS_TAO)
- RTC_PARANOID(("received data size: %d", cdr.cdr.length()));
+ RTC_PARANOID(("received data size: %d", cdr.cdr.total_length()));
#else
RTC_PARANOID(("received data size: %d", cdr.bufSize()));
#endif
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -109,7 +109,7 @@
#ifdef ORB_IS_ORBEXPRESS
data.cdr.write_array_1(cdr_data->get_buffer(), (CORBA::ULong)cdr_data->length());
#elif defined(ORB_IS_TAO)
- data.cdr.write_octet_array(cdr_data->get_buffer(), (CORBA::ULong)cdr_data->length());
+ data.decodeCDRData(cdr_data.in());
#else
data.put_octet_array(&(cdr_data[0]), (int)cdr_data->length());
#endif
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -183,7 +183,7 @@
#ifdef ORB_IS_ORBEXPRESS
CORBA::ULong len((CORBA::ULong)cdr.cdr.size_written());
#elif defined(ORB_IS_TAO)
- CORBA::ULong len((CORBA::ULong)cdr.cdr.length());
+ CORBA::ULong len((CORBA::ULong)cdr.cdr.total_length());
#else
CORBA::ULong len((CORBA::ULong)cdr.bufSize());
#endif
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -89,7 +89,7 @@
#ifdef ORB_IS_ORBEXPRESS
RTC_PARANOID(("data size = %d bytes", data.cdr.size_written()));
#elif defined(ORB_IS_TAO)
- RTC_PARANOID(("data size = %d bytes", data.cdr.length()));
+ RTC_PARANOID(("data size = %d bytes", data.cdr.total_length()));
#else
RTC_PARANOID(("data size = %d bytes", data.bufSize()));
#endif
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -136,7 +136,7 @@
#ifdef ORB_IS_ORBEXPRESS
RTC_PARANOID(("CDR data length: %d", data.cdr.size_written()));
#elif defined(ORB_IS_TAO)
- RTC_PARANOID(("CDR data length: %d", data.cdr.length()));
+ RTC_PARANOID(("CDR data length: %d", data.cdr.total_length()));
#else
RTC_PARANOID(("CDR data length: %d", data.bufSize()));
#endif
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMProvider.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -178,7 +178,7 @@
#ifdef ORB_IS_ORBEXPRESS
CORBA::ULong len((CORBA::ULong)cdr.cdr.size_written());
#elif defined(ORB_IS_TAO)
- CORBA::ULong len((CORBA::ULong)cdr.cdr.length());
+ CORBA::ULong len((CORBA::ULong)cdr.cdr.total_length());
#else
CORBA::ULong len((CORBA::ULong)cdr.bufSize());
#endif
Modified: trunk/OpenRTM-aist/src/lib/rtm/RTC.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTC.h 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTC.h 2018-01-28 11:34:31 UTC (rev 3209)
@@ -30,6 +30,7 @@
#ifdef ORB_IS_TAO
#include <tao/corba.h>
#include <orbsvcs/CosNamingC.h>
+#include <rtm/idl/DataPortSkel.h>
#endif
#ifdef ORB_IS_RTORB
@@ -110,20 +111,54 @@
class cdrMemoryStream
{
public:
- cdrMemoryStream()
+ cdrMemoryStream()
{
};
cdrMemoryStream(const cdrMemoryStream& rhs)
{
- cdr.write_char_array(rhs.cdr.buffer(), rhs.cdr.length());
+ for (const ACE_Message_Block *i = rhs.cdr.begin(); i != 0; i = i->cont())
+ {
+ cdr.write_octet_array_mb(i);
+ }
};
cdrMemoryStream& operator= (const cdrMemoryStream& rhs)
{
- cdr.write_char_array(rhs.cdr.buffer(), rhs.cdr.length());
+ for (const ACE_Message_Block *i = rhs.cdr.begin(); i != 0; i = i->cont())
+ {
+ cdr.write_octet_array_mb(i);
+ }
return *this;
};
+ void encodeCDRData(::OpenRTM::CdrData *data)
+ {
+ data->length(cdr.total_length());
+ CORBA::Octet *buf = data->get_buffer();
+ for (const ACE_Message_Block *i = cdr.begin(); i != 0; i = i->cont())
+ {
+ const size_t len = i->length();
+ ACE_OS::memcpy(buf, i->rd_ptr(), len);
+ buf += len;
+ }
+ }
+
+ void encodeCDRData(::OpenRTM::CdrData &data)
+ {
+ encodeCDRData(&data);
+ }
+
+
+ void decodeCDRData(const ::OpenRTM::CdrData *data)
+ {
+ cdr.write_octet_array(data->get_buffer(), data->length());
+ }
+
+ void decodeCDRData(const ::OpenRTM::CdrData &data)
+ {
+ decodeCDRData(&data);
+ }
+
TAO_OutputCDR cdr;
};
//typedef TAO_OutputCDR cdrMemoryStream;
Modified: trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp 2018-01-25 09:41:07 UTC (rev 3208)
+++ trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp 2018-01-28 11:34:31 UTC (rev 3209)
@@ -253,7 +253,7 @@
#ifdef ORB_IS_ORBEXPRESS
CORBA::ULongLong data_size = (CORBA::ULongLong)data.cdr.size_written();
#elif defined(ORB_IS_TAO)
- CORBA::ULongLong data_size = (CORBA::ULongLong)data.cdr.length();
+ CORBA::ULongLong data_size = (CORBA::ULongLong)data.cdr.total_length();
#else
CORBA::ULongLong data_size = (CORBA::ULongLong)data.bufSize();
#endif
@@ -292,7 +292,7 @@
#ifdef ORB_IS_ORBEXPRESS
m_shmem.write(const_cast<char*>(data.get_buffer()), sizeof(CORBA::ULongLong), data.cdr.size_written());
#elif defined(ORB_IS_TAO)
- m_shmem.write((char*)data.cdr.buffer(), sizeof(CORBA::ULongLong), data.cdr.length());
+ m_shmem.write((char*)data.cdr.buffer(), sizeof(CORBA::ULongLong), data.cdr.total_length());
#else
m_shmem.write((char*)data.bufPtr(), sizeof(CORBA::ULongLong), data.bufSize());
More information about the openrtm-commit
mailing list