[openrtm-commit:02843] r3049 - trunk/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 9月 27日 (水) 16:13:10 JST
Author: miyamoto
Date: 2017-09-27 16:13:10 +0900 (Wed, 27 Sep 2017)
New Revision: 3049
Modified:
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/InPortCorbaCdrProvider.cpp
trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
trunk/OpenRTM-aist/src/lib/rtm/Manager.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h
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/RTC.h
Log:
[incompat, VxWorks] fixed bug.
Modified: trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-09-27 07:13:10 UTC (rev 3049)
@@ -27,12 +27,7 @@
#include <rtm/RTC.h>
#include <rtm/ConnectorBase.h>
-#ifdef ORB_IS_ORBEXPRESS
-class CORBA::Stream;
-typedef CORBA::Stream cdrMemoryStream;
-#else
class cdrMemoryStream;
-#endif
namespace RTC
{
@@ -352,13 +347,13 @@
#ifdef ORB_IS_ORBEXPRESS
if (endian[0] == "little")
{
- cdr.is_little_endian(true);
+ cdr.cdr.is_little_endian(true);
}
else if (endian[0] == "big")
{
- cdr.is_little_endian(false);
+ cdr.cdr.is_little_endian(false);
}
- cdr >> data;
+ cdr.cdr >> data;
#elif defined(ORB_IS_TAO)
TAO_InputCDR(cdr.cdr) >> data;
#else
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-09-27 07:13:10 UTC (rev 3049)
@@ -441,7 +441,7 @@
Guard guard(m_valueMutex);
RTC_DEBUG(("data read succeeded"));
#ifdef ORB_IS_ORBEXPRESS
- cdr >> m_value;
+ cdr.cdr >> m_value;
#elif defined(ORB_IS_TAO)
TAO_InputCDR(cdr.cdr) >> m_value;
#else
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-09-27 07:13:10 UTC (rev 3049)
@@ -36,12 +36,7 @@
};
#endif // ORB_IS_RTORB
-#ifdef ORB_IS_ORBEXPRESS
-class CORBA::Stream;
-typedef CORBA::Stream cdrMemoryStream;
-#else
class cdrMemoryStream;
-#endif
namespace RTC
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2017-09-27 07:13:10 UTC (rev 3049)
@@ -72,11 +72,17 @@
#ifndef ORB_IS_RTORB
#ifdef ORB_IS_ORBEXPRESS
- CORBA::Octet* to;
- cdrMemoryStream data_tmp = data;
- *static_cast<CORBA::Octet*>(to) = data_tmp.read_octet();
- ::OpenRTM::CdrData tmp(data_tmp.size_written(), data_tmp.size_written(),
- to, 0);
+ cdrMemoryStream tmp_data;
+ tmp_data = data;
+ ::OpenRTM::CdrData tmp;
+ CORBA::ULong len = tmp_data.cdr.size_written();
+ tmp.length(len);
+ tmp_data.cdr.read_array_1((void*)tmp.get_buffer(), len);
+ //CORBA::Octet* to;
+ //cdrMemoryStream data_tmp = data;
+ //*static_cast<CORBA::Octet*>(to) = data_tmp.read_octet();
+ //::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(),
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2017-09-27 07:13:10 UTC (rev 3049)
@@ -159,7 +159,7 @@
{
cdrMemoryStream cdr;
#ifdef ORB_IS_ORBEXPRESS
- cdr.write_array_1(data.get_buffer(), data.length());
+ 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());
#else
Modified: trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2017-09-27 07:13:10 UTC (rev 3049)
@@ -52,6 +52,7 @@
#endif
#endif
+
#ifdef RTM_OS_LINUX
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -1548,6 +1549,14 @@
char** argv = coil::toArgv(args);
int argc(args.size());
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::ORB::spawn_flags(VX_SPE_TASK | VX_STDIO);
+ CORBA::ORB::stack_size(20000);
+ m_pORB = CORBA::ORB_init(argc, argv, "");
+ CORBA::Object_var obj =
+ m_pORB->resolve_initial_references((char*)"RootPOA");
+ m_pPOA = PortableServer::POA::_narrow(obj);
+#else
// ORB initialization
m_pORB = CORBA::ORB_init(argc, argv);
// Get the RootPOA
@@ -1554,6 +1563,7 @@
CORBA::Object_var obj =
m_pORB->resolve_initial_references((char*)"RootPOA");
m_pPOA = PortableServer::POA::_narrow(obj);
+#endif
if (CORBA::is_nil(m_pPOA))
{
RTC_ERROR(("Could not resolve RootPOA."));
Modified: trunk/OpenRTM-aist/src/lib/rtm/Manager.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Manager.h 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/Manager.h 2017-09-27 07:13:10 UTC (rev 3049)
@@ -36,6 +36,10 @@
#include <rtm/SystemLogger.h>
#include <rtm/ManagerActionListener.h>
+#ifdef ORB_IS_ORBEXPRESS
+#include <RTPortableServer.h>
+#endif
+
namespace RTM
{
class ManagerServant;
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-09-27 07:13:10 UTC (rev 3049)
@@ -249,11 +249,11 @@
}
// normal case
#ifdef ORB_IS_ORBEXPRESS
- m_cdr.rewind();
+ m_cdr.cdr.rewind();
RTC_TRACE(("connector endian: %s", isLittleEndian() ? "little":"big"));
- m_cdr.is_little_endian(isLittleEndian());
- m_cdr << data;
+ m_cdr.cdr.is_little_endian(isLittleEndian());
+ m_cdr.cdr << data;
#elif defined(ORB_IS_TAO)
m_cdr.cdr.reset();
RTC_TRACE(("connector endian: %s", isLittleEndian() ? "little" : "big"));
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-09-27 07:13:10 UTC (rev 3049)
@@ -107,7 +107,7 @@
{
RTC_DEBUG(("get() successful"));
#ifdef ORB_IS_ORBEXPRESS
- data.write_array_1(cdr_data->get_buffer(), (CORBA::ULong)cdr_data->length());
+ 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());
#else
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2017-09-27 07:13:10 UTC (rev 3049)
@@ -181,7 +181,7 @@
if (ret == CdrBufferBase::BUFFER_OK)
{
#ifdef ORB_IS_ORBEXPRESS
- CORBA::ULong len((CORBA::ULong)cdr.size_written());
+ CORBA::ULong len((CORBA::ULong)cdr.cdr.size_written());
#elif defined(ORB_IS_TAO)
CORBA::ULong len((CORBA::ULong)cdr.cdr.length());
#else
@@ -196,7 +196,7 @@
#ifndef ORB_IS_RTORB
data->length(len);
#ifdef ORB_IS_ORBEXPRESS
- cdr.read_array_1(data->get_buffer(), len);
+ cdr.cdr.read_array_1(data->get_buffer(), len);
#elif defined(ORB_IS_TAO)
TAO_InputCDR(cdr.cdr).read_octet_array(&((*data)[0]), len);
#else
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-09-27 07:13:10 UTC (rev 3049)
@@ -87,7 +87,7 @@
{
RTC_TRACE(("write()"));
#ifdef ORB_IS_ORBEXPRESS
- RTC_PARANOID(("data size = %d bytes", data.size_written()));
+ RTC_PARANOID(("data size = %d bytes", data.cdr.size_written()));
#elif defined(ORB_IS_TAO)
RTC_PARANOID(("data size = %d bytes", data.cdr.length()));
#else
Modified: trunk/OpenRTM-aist/src/lib/rtm/RTC.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTC.h 2017-09-23 16:27:51 UTC (rev 3048)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTC.h 2017-09-27 07:13:10 UTC (rev 3049)
@@ -89,7 +89,23 @@
};
#ifdef ORB_IS_ORBEXPRESS
-typedef CORBA::Stream cdrMemoryStream;
+class cdrMemoryStream
+{
+public:
+ cdrMemoryStream()
+ {
+ };
+ cdrMemoryStream(const cdrMemoryStream &rhs)
+ {
+ cdr.copy(rhs.cdr);
+ };
+ cdrMemoryStream& operator= (const cdrMemoryStream &rhs)
+ {
+ cdr.copy(rhs.cdr);
+ return *this;
+ };
+ CORBA::Stream cdr;
+};
#elif defined(ORB_IS_TAO)
class cdrMemoryStream
{
More information about the openrtm-commit
mailing list