[openrtm-commit:02904] r3063 - in trunk/OpenRTM-aist: . src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 11月 7日 (火) 16:37:46 JST
Author: miyamoto
Date: 2017-11-07 16:37:46 +0900 (Tue, 07 Nov 2017)
New Revision: 3063
Modified:
trunk/OpenRTM-aist/CMakeLists.txt
trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
trunk/OpenRTM-aist/src/lib/rtm/InPort.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/PeriodicECSharedComposite.cpp
trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp
Log:
[compat] Support TAO.
Modified: trunk/OpenRTM-aist/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/CMakeLists.txt 2017-11-06 13:08:01 UTC (rev 3062)
+++ trunk/OpenRTM-aist/CMakeLists.txt 2017-11-07 07:37:46 UTC (rev 3063)
@@ -59,7 +59,13 @@
set(IDL_COMPILE_COMMAND ${ORB_ROOT}/bin/tao_idl)
endif(VXWORKS)
endif()
- SET(IDLCOMMAND_FLAGS -as -DTAO_IDL -I${ORB_ROOT}/TAO)
+ if(UNIX)
+ SET(IDLCOMMAND_FLAGS -as -DTAO_IDL -I${ORB_ROOT}/include)
+ elseif(VXWORKS)
+ SET(IDLCOMMAND_FLAGS -as -DTAO_IDL -I${ORB_ROOT}/TAO)
+ elseif(MSVC)
+ SET(IDLCOMMAND_FLAGS -as -DTAO_IDL -I${ORB_ROOT}/TAO)
+ endif()
endif()
if(UNIX)
Modified: trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-11-06 13:08:01 UTC (rev 3062)
+++ trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-11-07 07:37:46 UTC (rev 3063)
@@ -355,7 +355,8 @@
}
cdr.cdr >> data;
#elif defined(ORB_IS_TAO)
- TAO_InputCDR(cdr.cdr) >> data;
+ TAO_InputCDR tao_cdr = TAO_InputCDR(cdr.cdr);
+ tao_cdr >> data;
#else
if (endian[0] == "little")
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-11-06 13:08:01 UTC (rev 3062)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-11-07 07:37:46 UTC (rev 3063)
@@ -443,7 +443,8 @@
#ifdef ORB_IS_ORBEXPRESS
cdr.cdr >> m_value;
#elif defined(ORB_IS_TAO)
- TAO_InputCDR(cdr.cdr) >> m_value;
+ TAO_InputCDR tao_cdr = TAO_InputCDR(cdr.cdr);
+ tao_cdr >> m_value;
#else
m_value <<= cdr;
#endif
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp 2017-11-06 13:08:01 UTC (rev 3062)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortSHMConsumer.cpp 2017-11-07 07:37:46 UTC (rev 3063)
@@ -132,8 +132,13 @@
m_shmem.read(data);
RTC_DEBUG(("get() successful"));
-
+#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()));
+#else
RTC_PARANOID(("CDR data length: %d", data.bufSize()));
+#endif
onReceived(data);
onBufferWrite(data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/PeriodicECSharedComposite.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PeriodicECSharedComposite.cpp 2017-11-06 13:08:01 UTC (rev 3062)
+++ trunk/OpenRTM-aist/src/lib/rtm/PeriodicECSharedComposite.cpp 2017-11-07 07:37:46 UTC (rev 3063)
@@ -130,7 +130,11 @@
for (::CORBA::ULong i(0), len(sdo_list.length()); i < len; ++i)
{
#ifndef ORB_IS_RTORB
+#ifdef ORB_IS_TAO
+ const SDO_var sdo = sdo_list[i].in();
+#else
const SDO_var sdo = sdo_list[i];
+#endif
::OpenRTM::DataFlowComponent_var dfc;
if (!sdoToDFC(sdo.in(), dfc.out())) { continue; }
#else // ORB_IS_RTORB
Modified: trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp 2017-11-06 13:08:01 UTC (rev 3062)
+++ trunk/OpenRTM-aist/src/lib/rtm/SharedMemoryPort.cpp 2017-11-07 07:37:46 UTC (rev 3063)
@@ -250,7 +250,13 @@
*/
void SharedMemoryPort::write(const cdrMemoryStream& data)
{
+#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();
+#else
CORBA::ULongLong data_size = (CORBA::ULongLong)data.bufSize();
+#endif
if (data_size + sizeof(CORBA::ULongLong) > m_shmem.get_size())
{
int memory_size = (int)data_size + (int)sizeof(CORBA::ULongLong);
@@ -286,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.buffer(), sizeof(CORBA::ULongLong), data.cdr.length());
+ m_shmem.write((char*)data.cdr.buffer(), sizeof(CORBA::ULongLong), data.cdr.length());
#else
m_shmem.write((char*)data.bufPtr(), sizeof(CORBA::ULongLong), data.bufSize());
@@ -321,11 +327,12 @@
#ifdef ORB_IS_ORBEXPRESS
data.is_little_endian(m_endian);
data_size_cdr.is_little_endian(m_endian);
- data_size_cdr.write_array_1(data_size_str[0], sizeof(CORBA::ULongLong));
+ data_size_cdr.write_array_1((CORBA::Octet *)&(m_shmem.get_data()[0]), sizeof(CORBA::ULongLong));
data_size_cdr.cdr >> data_size;
#elif defined(ORB_IS_TAO)
- data_size_cdr.write_octet_array(data_size_str[0], sizeof(CORBA::ULongLong));
- TAO_InputCDR(data_size_cdr.cdr) >> data_size;
+ data_size_cdr.cdr.write_octet_array((CORBA::Octet *)&(m_shmem.get_data()[0]), sizeof(CORBA::ULongLong));
+ TAO_InputCDR tao_cdr = TAO_InputCDR(data_size_cdr.cdr);
+ tao_cdr >> data_size;
#else
data.setByteSwapFlag(m_endian);
data_size_cdr.setByteSwapFlag(m_endian);
@@ -343,7 +350,13 @@
data.put_octet_array(&(shm_data[0]), (int)data_size);
}*/
+#ifdef ORB_IS_ORBEXPRESS
+ data.cdr.write_array_1((CORBA::Octet *)&(m_shmem.get_data()[sizeof(CORBA::ULongLong)]), (int)data_size);
+#elif defined(ORB_IS_TAO)
+ data.cdr.write_octet_array((CORBA::Octet *)&(m_shmem.get_data()[sizeof(CORBA::ULongLong)]), (int)data_size);
+#else
data.put_octet_array((CORBA::Octet *)&(m_shmem.get_data()[sizeof(CORBA::ULongLong)]), (int)data_size);
+#endif
//delete shm_data;
}
More information about the openrtm-commit
mailing list