[openrtm-commit:02617] r2994 - in trunk/OpenRTM-aist: src/lib src/lib/coil src/lib/coil/common src/lib/coil/vxworks/coil src/lib/rtm src/lib/rtm/idl utils/rtm-skelwrapper
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 5月 30日 (火) 18:47:01 JST
Author: miyamoto
Date: 2017-05-30 18:47:01 +0900 (Tue, 30 May 2017)
New Revision: 2994
Added:
trunk/OpenRTM-aist/src/lib/Toolchain-vxworks6.cmake
trunk/OpenRTM-aist/src/lib/coil/CMakeLists.txt
trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt
trunk/OpenRTM-aist/src/lib/rtm/idl/CMakeLists.txt
Modified:
trunk/OpenRTM-aist/src/lib/coil/common/ClockManager.cpp
trunk/OpenRTM-aist/src/lib/coil/common/stringutil.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Condition.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.cpp
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/File.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/OS.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.cpp
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Routing.cpp
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.cpp
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Time.h
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp
trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.h
trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.cpp
trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.h
trunk/OpenRTM-aist/src/lib/rtm/CORBA_SeqUtil.h
trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
trunk/OpenRTM-aist/src/lib/rtm/CorbaConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.cpp
trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.h
trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp
trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.h
trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp
trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.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/InPortDirectConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
trunk/OpenRTM-aist/src/lib/rtm/ManagerConfig.cpp
trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp
trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.h
trunk/OpenRTM-aist/src/lib/rtm/ModuleManager.cpp
trunk/OpenRTM-aist/src/lib/rtm/NamingManager.cpp
trunk/OpenRTM-aist/src/lib/rtm/NamingManager.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortConsumer.h
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp
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/PeriodicECSharedComposite.cpp
trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.cpp
trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.h
trunk/OpenRTM-aist/src/lib/rtm/PortBase.cpp
trunk/OpenRTM-aist/src/lib/rtm/PortBase.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
trunk/OpenRTM-aist/src/lib/rtm/RTC.h
trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp
trunk/OpenRTM-aist/src/lib/rtm/RTObject.h
trunk/OpenRTM-aist/src/lib/rtm/SdoConfiguration.cpp
trunk/OpenRTM-aist/utils/rtm-skelwrapper/skel_wrapper.py
Log:
[incompat] support VxWorks. refs #4105
Added: trunk/OpenRTM-aist/src/lib/Toolchain-vxworks6.cmake
===================================================================
--- trunk/OpenRTM-aist/src/lib/Toolchain-vxworks6.cmake (rev 0)
+++ trunk/OpenRTM-aist/src/lib/Toolchain-vxworks6.cmake 2017-05-30 09:47:01 UTC (rev 2994)
@@ -0,0 +1,344 @@
+# VxWorks 6.6 settings
+#
+# for J3 Main ECU
+#
+SET (VX_TOOL_FAMILY gnu)
+SET (VX_TOOL sfgnu)
+
+
+set(RTP ${RTP} CACHE BOOL "set RTP")
+
+if(RTP)
+ set(RTP_C_FLAGS -mrtp)
+endif()
+
+
+
+set(VX_CPU_FAMILY ${VX_CPU_FAMILY} CACHE STRING "set VX_CPU_FAMILY ")
+
+if(NOT VX_CPU_FAMILY)
+ set(VX_CPU_FAMILY ppc)
+endif()
+
+if("${VX_CPU_FAMILY}" STREQUAL "ppc")
+ SET (VX_CPU PPC32)
+elseif("${VX_CPU_FAMILY}" STREQUAL "simpentium")
+ SET (VX_CPU SIMPENTIUM)
+elseif("${VX_CPU_FAMILY}" STREQUAL "simlinux")
+ SET (VX_CPU SIMLINUX)
+endif()
+
+
+
+
+#message(STATUS "test")
+#message(STATUS ${VX_CPU_FAMILY})
+
+#SET (VX_CPU_FAMILY ppc)
+#SET (VX_CPU PPC32)
+SET (VX_CPU_CARD ADS8572)
+SET (VX_CPU_VARIANT _ppc85XX_e500v2)
+
+
+if(NOT VX_VERSION)
+ SET (VX_VERSION vxworks-6.9)
+endif()
+
+if("${VX_VERSION}" STREQUAL "vxworks-6.9")
+ SET (GNU_VERSION 4.3.3)
+ ADD_DEFINITIONS (-DVXWORKS_69)
+else()
+ SET (GNU_VERSION 4.1.2)
+ ADD_DEFINITIONS (-DVXWORKS_66)
+endif()
+
+# ホストOSの判定
+FIND_PROGRAM (UNAME uname)
+MARK_AS_ADVANCED (UNAME)
+EXECUTE_PROCESS (COMMAND ${UNAME} OUTPUT_VARIABLE VXWORKS_HOST_OS)
+
+IF (VXWORKS_HOST_OS MATCHES "SunOS")
+ SET (WIND_HOST_TYPE sun4-solaris2)
+ SET (WIND_HOME /usr/local/vw/workbench3.0)
+ELSEIF (VXWORKS_HOST_OS MATCHES "Linux")
+ SET (WIND_HOST_TYPE x86-linux2)
+ IF (NOT EXISTS "$ENV{WIND_HOME}")
+ MESSAGE (STATUS "WIND_HOME=$ENV{WIND_HOME}")
+ MESSAGE (FATAL_ERROR "Please provide valid WIND_HOME environment variable.")
+ ENDIF (NOT EXISTS "$ENV{WIND_HOME}")
+ SET (WIND_HOME "$ENV{WIND_HOME}")
+ENDIF (VXWORKS_HOST_OS MATCHES "SunOS")
+
+# Path Settings
+SET (WIND_BASE ${WIND_HOME}/${VX_VERSION})
+SET (WIND_GNU_BASE ${WIND_HOME}/gnu/${GNU_VERSION}-${VX_VERSION}/${WIND_HOST_TYPE})
+SET (VX_VW_BASE ${WIND_BASE}/target)
+
+# environment variables required by compiler
+SET (WIND_ENV "WIND_HOME=${WIND_HOME} WIND_HOST_TYPE=${WIND_HOST_TYPE} WIND_BASE=${WIND_BASE}")
+
+################################################################################
+
+SET (VXWORKS ON)
+SET (VXWORKS_MAJOR 6)
+SET (VXWORKS_MINOR 6)
+
+SET (CMAKE_SYSTEM_NAME VxWorks)
+SET (CMAKE_SYSTEM_VERSION ${VX_VERSION})
+SET (CMAKE_SYSTEM_PROCESSOR ${VX_CPU_FAMILY})
+
+INCLUDE (CMakeForceCompiler)
+
+if("${VX_CPU_FAMILY}" STREQUAL "ppc")
+ CMAKE_FORCE_C_COMPILER(${WIND_GNU_BASE}/bin/ccppc GNU)
+ CMAKE_FORCE_CXX_COMPILER(${WIND_GNU_BASE}/bin/c++ppc GNU)
+ SET (CMAKE_LINKER ${WIND_GNU_BASE}/bin/ldppc CACHE FILEPATH "vxworks linker")
+ SET (CMAKE_AR ${WIND_GNU_BASE}/bin/arppc CACHE FILEPATH "vxworks ar")
+ SET (CMAKE_NM ${WIND_GNU_BASE}/bin/nmppc CACHE FILEPATH "vxworks nm")
+ SET (CMAKE_STRIP ${WIND_GNU_BASE}/bin/stripppc CACHE FILEPATH "vxworks strip")
+ SET (CMAKE_OBJCOPY ${WIND_GNU_BASE}/bin/objcopyppc CACHE FILEPATH "vxworks objcopy")
+ SET (CMAKE_OBJDUMP ${WIND_GNU_BASE}/bin/objdumpppc CACHE FILEPATH "vxworks objdump")
+ SET (CMAKE_RANLIB ${WIND_GNU_BASE}/bin/ranlibppc CACHE FILEPATH "vxworks ranlib")
+elseif("${VX_CPU_FAMILY}" STREQUAL "simpentium")
+ CMAKE_FORCE_C_COMPILER(${WIND_GNU_BASE}/bin/ccpentium GNU)
+ CMAKE_FORCE_CXX_COMPILER(${WIND_GNU_BASE}/bin/c++pentium GNU)
+ SET (CMAKE_LINKER ${WIND_GNU_BASE}/bin/ldpentium CACHE FILEPATH "vxworks linker")
+ SET (CMAKE_AR ${WIND_GNU_BASE}/bin/arpentium CACHE FILEPATH "vxworks ar")
+ SET (CMAKE_NM ${WIND_GNU_BASE}/bin/nmpentium CACHE FILEPATH "vxworks nm")
+ SET (CMAKE_STRIP ${WIND_GNU_BASE}/bin/strippentium CACHE FILEPATH "vxworks strip")
+ SET (CMAKE_OBJCOPY ${WIND_GNU_BASE}/bin/objcopypentium CACHE FILEPATH "vxworks objcopy")
+ SET (CMAKE_OBJDUMP ${WIND_GNU_BASE}/bin/objdumppentium CACHE FILEPATH "vxworks objdump")
+ SET (CMAKE_RANLIB ${WIND_GNU_BASE}/bin/ranlibpentium CACHE FILEPATH "vxworks ranlib")
+elseif("${VX_CPU_FAMILY}" STREQUAL "simlinux")
+ CMAKE_FORCE_C_COMPILER(${WIND_GNU_BASE}/bin/ccpentium GNU)
+ CMAKE_FORCE_CXX_COMPILER(${WIND_GNU_BASE}/bin/c++pentium GNU)
+ SET (CMAKE_LINKER ${WIND_GNU_BASE}/bin/ldpentium CACHE FILEPATH "vxworks linker")
+ SET (CMAKE_AR ${WIND_GNU_BASE}/bin/arpentium CACHE FILEPATH "vxworks ar")
+ SET (CMAKE_NM ${WIND_GNU_BASE}/bin/nmpentium CACHE FILEPATH "vxworks nm")
+ SET (CMAKE_STRIP ${WIND_GNU_BASE}/bin/strippentium CACHE FILEPATH "vxworks strip")
+ SET (CMAKE_OBJCOPY ${WIND_GNU_BASE}/bin/objcopypentium CACHE FILEPATH "vxworks objcopy")
+ SET (CMAKE_OBJDUMP ${WIND_GNU_BASE}/bin/objdumppentium CACHE FILEPATH "vxworks objdump")
+ SET (CMAKE_RANLIB ${WIND_GNU_BASE}/bin/ranlibpentium CACHE FILEPATH "vxworks ranlib")
+endif()
+
+
+
+SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
+SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
+SET (CMAKE_EXE_LINKER_FLAGS_INIT -r)
+
+
+
+
+
+FIND_PROGRAM (SH sh REQUIRED)
+SET (MUNCH ${WIND_BASE}/host/${WIND_HOST_TYPE}/bin/munch CACHE FILEPATH "munch")
+
+SET (CMAKE_C_COMPILE_OBJECT
+ "${WIND_ENV} <CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+SET (CMAKE_CXX_COMPILE_OBJECT
+ "${WIND_ENV} <CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
+
+#set(LINKER_FLAGS "-mhard-float -fno-implicit-fp -mstrict-align -mregnames -D_WRS_HARDWARE_FP -mrtp -fno-strict-aliasing -fasm -Wall" )
+
+
+#set(LINKER_FLAGS "-mhard-float -fno-implicit-fp -mstrict-align -mregnames -fno-strict-aliasing -fasm -Wall" )
+
+if("${VX_CPU_FAMILY}" STREQUAL "ppc")
+
+
+ SET (CMAKE_C_FLAGS_DEBUG "-g" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "")
+
+ SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -fstrength-reduce -fno-builtin" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} CACHE STRING "")
+
+ SET (CMAKE_C_FLAGS_RELEASE "-O2 -fstrength-reduce -fno-builtin" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "")
+
+ SET (CC_ARCH_SPEC "-mhard-float -fno-implicit-fp -mstrict-align -mregnames -D_WRS_HARDWARE_FP")
+
+elseif("${VX_CPU_FAMILY}" STREQUAL "simpentium")
+
+ SET (CMAKE_C_FLAGS_DEBUG "-g" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "")
+
+ SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -fno-defer-pop" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} CACHE STRING "")
+
+ SET (CMAKE_C_FLAGS_RELEASE "-O2 -fno-defer-pop" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "")
+
+ SET (CC_ARCH_SPEC "-mtune=i486 -march=i486")
+
+
+elseif("${VX_CPU_FAMILY}" STREQUAL "simlinux")
+
+ SET (CMAKE_C_FLAGS_DEBUG "-g" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "")
+
+ SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -fno-defer-pop" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} CACHE STRING "")
+
+ SET (CMAKE_C_FLAGS_RELEASE "-O2 -fno-defer-pop" CACHE STRING "")
+ SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "")
+
+ SET (CC_ARCH_SPEC "-mtune=i486 -march=i486")
+
+endif()
+
+if(RTP)
+ #set(CMAKE_EXE_LINKER_FLAGS "${CC_ARCH_SPEC} ${RTP_C_FLAGS} -fno-strict-aliasing -fasm -Wall" )
+ set(CMAKE_EXE_LINKER_FLAGS "${CC_ARCH_SPEC} ${RTP_C_FLAGS} -fno-strict-aliasing -lstdc++ -fasm -D_WRS_HARDWARE_FP -Wall" )
+else(RTP)
+ set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,-X -T ${WIND_BASE}/target/h/tool/gnu/ldscripts/link.OUT " )
+endif()
+
+
+SET (CMAKE_C_LINK_EXECUTABLE
+ "${CMAKE_C_COMPILER} ${CMAKE_EXE_LINKER_FLAGS} <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+SET (CMAKE_CXX_LINK_EXECUTABLE
+ "${CMAKE_CXX_COMPILER} ${CMAKE_EXE_LINKER_FLAGS} <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+
+
+#if(RTP)
+# set(CMAKE_EXE_LINKER_FLAGS "${CC_ARCH_SPEC} ${RTP_C_FLAGS} -fno-strict-aliasing -fasm -Wall" )
+#else(RTP)
+# set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,-X" )
+#endif()
+
+#SET (CMAKE_C_FLAGS_DEBUG "-O -g1" CACHE STRING "")
+#SET (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "")
+
+#SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O -g1 -DNDEBUG" CACHE STRING "")
+#SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} CACHE STRING "")
+
+#SET (CMAKE_C_FLAGS_RELEASE "-O -g1 -DNDEBUG" CACHE STRING "")
+#SET (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "")
+
+if(RTP)
+INCLUDE_DIRECTORIES (
+ ${VX_VW_BASE}/usr/h
+ ${VX_VW_BASE}/usr/h/wrn/coreip)
+else(RTP)
+INCLUDE_DIRECTORIES (
+ ${VX_VW_BASE}/h
+ ${VX_VW_BASE}/h/wrn/coreip)
+message(STATUS ${VX_VW_BASE}/h/wrn/coreip)
+endif()
+
+
+SET (VSB_DIR ${WIND_BASE}/target/lib)
+SET (VSB_CONFIG_FILE ${VSB_DIR}/h/config/vsbConfig.h)
+
+
+
+
+
+
+SET (VXWORKS_C_FLAGS_LIST
+# -D_VX_CPU=_VX_${VX_CPU}
+# -D_VX_CPU_FAMILY=_VX_${VX_CPU}
+# -D_VX_TOOL_FAMILY=${VX_TOOL_FAMILY}
+# -D_VX_TOOL=${VX_TOOL}
+ -DCPU=${VX_CPU}
+ -DVX_CPU_CARD=${VX_CPU_CARD}
+# -DCPU_FAMILY=_${CPU_FAMILY}
+ -DTOOL_FAMILY=${VX_TOOL_FAMILY}
+ -DTOOL=${VX_TOOL}
+ -D_WRS_KERNEL
+ -DCPU_VARIANT=${VX_CPU_VARIANT}
+# -D_VSB_CONFIG_FILE="${VSB_CONFIG_FILE}"
+ -DVXWORKS_MAJOR=${VXWORKS_MAJOR}
+ -DVXWORKS_MINOR=${VXWORKS_MINOR}
+ -DVXWORKS
+# ${CC_ARCH_SPEC}
+# -ansi
+# -mrtp
+ )
+
+
+ADD_DEFINITIONS (${VXWORKS_C_FLAGS_LIST})
+
+
+
+
+
+
+
+if("${VX_CPU_FAMILY}" STREQUAL "ppc")
+ if(RTP)
+ SET (CPU_C_FLAGS_LIST
+ ${RTP_C_FLAGS}
+ -mregnames
+ -msoft-float
+ )
+ else(RTP)
+ SET (CPU_C_FLAGS_LIST
+ -mlongcall
+ -fstrength-reduce
+ -fno-builtin
+ -te500v2
+ -mcpu=8548
+ -mfloat-gprs=double
+ -mspe=yes
+ -mabi=spe
+ -mstrict-align
+ -fno-implicit-fp
+ ${RTP_C_FLAGS}
+ )
+ endif()
+elseif("${VX_CPU_FAMILY}" STREQUAL "simpentium")
+ SET (CPU_C_FLAGS_LIST
+ -mtune=i486
+ -march=i486
+ -ansi
+ ${RTP_C_FLAGS}
+ )
+elseif("${VX_CPU_FAMILY}" STREQUAL "simlinux")
+ SET (CPU_C_FLAGS_LIST
+ -mtune=i486
+ -march=i486
+ -ansi
+ ${RTP_C_FLAGS}
+ )
+endif()
+
+ADD_DEFINITIONS (${CPU_C_FLAGS_LIST})
+
+
+
+if("${VX_CPU_FAMILY}" STREQUAL "ppc")
+ if(RTP)
+ set(COMMON_DIR sfcommon)
+ else(RTP)
+ set(COMMON_DIR common)
+ endif()
+elseif("${VX_CPU_FAMILY}" STREQUAL "simpentium")
+ set(COMMON_DIR common)
+elseif("${VX_CPU_FAMILY}" STREQUAL "simlinux")
+ set(COMMON_DIR common)
+endif()
+
+#link_directories(${WIND_BASE}/target/lib/usr/lib/${VX_CPU_FAMILY}/${CPU}/common)
+
+if(RTP)
+ if("${VX_VERSION}" STREQUAL "vxworks-6.9")
+ link_directories(${WIND_BASE}/target/lib/usr/lib/${VX_CPU_FAMILY}/${VX_CPU}/${COMMON_DIR})
+ else()
+ link_directories(${WIND_BASE}/target/usr/lib/${VX_CPU_FAMILY}/${VX_CPU}/${COMMON_DIR})
+ endif()
+else(RTP)
+ link_directories(${WIND_BASE}/target/lib/${VX_CPU_FAMILY}/${VX_CPU}/${COMMON_DIR})
+endif()
+#link_directories(${WIND_BASE}/target/usr/lib/${VX_CPU_FAMILY}/${VX_CPU}/common)
+#link_directories(${WIND_BASE}/target/lib/${VX_CPU_FAMILY}/${VX_CPU}/e500v2common)
+#link_directories(${WIND_BASE}/target/usr/lib/simpentium/SIMPENTIUM/common)
+
+
+MARK_AS_ADVANCED (CMAKE_LINKER CMAKE_AR CMAKE_NM CMAKE_STRIP
+ CMAKE_OBJCOPY CMAKE_OBJDUMP CMAKE_RANLIB CMAKE_C_FLAGS_DEBUG
+ CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_RELEASE SH MUNCH)
Added: trunk/OpenRTM-aist/src/lib/coil/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/CMakeLists.txt (rev 0)
+++ trunk/OpenRTM-aist/src/lib/coil/CMakeLists.txt 2017-05-30 09:47:01 UTC (rev 2994)
@@ -0,0 +1,46 @@
+cmake_minimum_required (VERSION 2.6)
+project (coil)
+
+
+
+
+
+
+
+
+
+set(coil_srcs
+ common/coil/Allocator.cpp
+ common/coil/ClockManager.cpp
+ common/coil/PeriodicTask.cpp
+ common/coil/Properties.cpp
+ common/coil/TimeMeasure.cpp
+ common/coil/TimeValue.cpp
+ common/coil/Timer.cpp
+ common/coil/crc.cpp
+ common/coil/stringutil.cpp
+ vxworks/coil/Condition.cpp
+ vxworks/coil/DynamicLib.cpp
+ vxworks/coil/Mutex.cpp
+# vxworks/coil/Routing.cpp
+ vxworks/coil/Process.cpp
+ vxworks/coil/Signal.cpp
+ vxworks/coil/Task.cpp
+ vxworks/coil/Time.cpp
+ vxworks/coil/UUID.cpp
+
+
+)
+
+
+include_directories(
+ ${PROJECT_SOURCE_DIR}/common
+ ${PROJECT_SOURCE_DIR}/vxworks
+ )
+message(STATUS ${CMAKE_INCLUDE_DIRECTORIES_BEFORE})
+
+add_library(coil STATIC ${coil_srcs} )
+#add_executable(coil ${coil_srcs} )
+
+
+
Modified: trunk/OpenRTM-aist/src/lib/coil/common/ClockManager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/common/ClockManager.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/common/ClockManager.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -34,6 +34,16 @@
}
bool SystemClock::settime(coil::TimeValue clocktime)
{
+#if defined(VXWORKS_66) && !defined(__RTP__)
+ timespec tv;
+ tv.tv_sec = clocktime.sec();
+ tv.tv_nsec = clocktime.usec()*1000;
+ if (coil::settimeofday(&tv) == 0)
+ {
+ return true;
+ }
+ return false;
+#else
timeval tv;
tv.tv_sec = clocktime.sec();
tv.tv_usec = clocktime.usec();
@@ -42,6 +52,7 @@
return true;
}
return false;
+#endif
}
//
//============================================================
Modified: trunk/OpenRTM-aist/src/lib/coil/common/stringutil.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/common/stringutil.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/common/stringutil.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -26,6 +26,7 @@
#include <sstream>
#if defined (_MSC_VER) && (_MSC_VER <=1500) // VC2008(VC9.0) or before
+#elif defined(VXWORKS_66) && !defined(__RTP__)
#else
#include <stdint.h>
#endif
@@ -728,10 +729,14 @@
template<class T>
std::string ptrToHex(T* n)
{
+#if defined(VXWORKS_66) && !defined(__RTP__)
+ return "";
+#else
std::stringstream ss;
ss << std::hex << std::showbase;
ss << reinterpret_cast<uintptr_t>(n);
return ss.str();
+#endif
};
/*!
@@ -761,6 +766,9 @@
template <class T>
bool hexToPtr(T*& ptr, const std::string str)
{
+#if defined(VXWORKS_66) && !defined(__RTP__)
+ return false;
+#else
std::stringstream s;
if ((s << std::hex << str).fail()) { return false; }
uintptr_t intval;
@@ -768,6 +776,7 @@
ptr = reinterpret_cast<T*>(intval);
if (ptr == NULL) { return false; }
return true;
+#endif
}
/*!
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Condition.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Condition.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Condition.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -23,7 +23,11 @@
#include <pthread.h>
#include <algorithm>
#include <ctime>
+#if defined(VXWORKS_66) && !defined(__RTP__)
+#include <timers.h>
+#else
#include <sys/time.h>
+#endif
namespace coil
{
@@ -177,6 +181,12 @@
*/
bool wait(long second, long nano_second = 0)
{
+#if defined(VXWORKS_66) && !defined(__RTP__)
+ timespec abstime;
+ ::clock_gettime(CLOCK_REALTIME, &abstime);
+ abstime.tv_sec += second;
+ abstime.tv_nsec += nano_second;
+#else
struct timeval tv;
timespec abstime;
@@ -183,6 +193,7 @@
::gettimeofday(&tv, NULL);
abstime.tv_sec = tv.tv_sec + second;
abstime.tv_nsec = tv.tv_usec * 1000 + nano_second;
+#endif
if (abstime.tv_nsec >= 1000000000) {
abstime.tv_nsec -= 1000000000;
abstime.tv_sec ++;
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -18,11 +18,17 @@
#include <coil/DynamicLib.h>
+#ifndef __RTP__
+#include <unldLib.h>
+#include <ioLib.h>
+#include <sysSymTbl.h>
+#endif
+
namespace coil
{
/*!
* @if jp
- * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+ * @brief コンストラクタ
* @else
* @brief Constructor
* @endif
@@ -34,7 +40,7 @@
/*!
* @if jp
- * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+ * @brief コンストラクタ
* @else
* @brief Constructor
* @endif
@@ -53,7 +59,7 @@
/*!
* @if jp
- * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+ * @brief デストラクタ
* @else
* @brief Destructor
* @endif
@@ -65,13 +71,17 @@
/*!
* @if jp
- * @brief ¥³¥Ô¡¼¥³¥ó¥¹¥È¥é¥¯¥¿
+ * @brief コピーコンストラクタ
* @else
* @brief Copy Constructor
* @endif
*/
DynamicLib::DynamicLib(const DynamicLib& rhs)
+#ifdef __RTP__
: m_name(""), m_mode(0), m_closeflag(0), m_handle(0)
+#else
+ : m_name(""), m_mode(0), m_fd(-1), m_id(0)
+#endif
{
if (!rhs.m_name.empty() &&
open(rhs.m_name.c_str(), rhs.m_mode, rhs.m_closeflag) == 0)
@@ -81,7 +91,7 @@
/*!
* @if jp
- * @brief ÂåÆþ±é»»»Ò
+ * @brief 代入演算子
* @else
* @brief Assignment operator
* @endif
@@ -92,13 +102,18 @@
std::swap(this->m_name, tmp.m_name);
std::swap(this->m_mode, tmp.m_mode);
std::swap(this->m_closeflag, tmp.m_closeflag);
+#ifdef __RTP__
std::swap(this->m_handle, tmp.m_handle);
+#else
+ std::swap(this->m_fd, tmp.m_fd);
+ std::swap(this->m_id, tmp.m_id);
+#endif
return *this;
}
/*!
* @if jp
- * @brief ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É
+ * @brief 動的リンクライブラリのロード
* @else
* @brief Load of the Dynamic link library
* @endif
@@ -107,6 +122,7 @@
int open_mode,
int close_handle_on_destruction)
{
+#ifdef __RTP__
void* handle = ::dlopen(dll_name, open_mode);
if (handle == NULL)
{
@@ -113,6 +129,20 @@
return -1;
}
m_handle = handle;
+
+#else
+ m_fd = ::open(const_cast<char*>(dll_name), O_RDONLY, 0);
+ if (!m_fd)
+ {
+ return -1;
+ }
+ m_id = loadModule(m_fd, open_mode);
+ if (!m_id)
+ {
+ ::close(m_fd);
+ return -1;
+ }
+#endif
m_name = dll_name;
return 0;
}
@@ -119,7 +149,7 @@
/*!
* @if jp
- * @brief ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤Î¥¢¥ó¥í¡¼¥É
+ * @brief 動的リンクライブラリのアンロード
* @else
* @brief Unload of the Dynamic link library
* @endif
@@ -126,6 +156,7 @@
*/
int DynamicLib::close(void)
{
+#ifdef __RTP__
if (m_handle == NULL)
return -1;
if (m_name.empty())
@@ -134,6 +165,16 @@
}
::dlclose(m_handle);
m_handle = NULL;
+#else
+ if (!m_id)
+ return -1;
+ if (m_name.empty())
+ {
+ return -1;
+ }
+ unldByModuleId(m_id, 0);
+ m_id = 0;
+#endif
m_name = "";
return 0;
}
@@ -140,7 +181,7 @@
/*!
* @if jp
- * @brief ¥·¥ó¥Ü¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤òÊÖ¤¹
+ * @brief シンボルがロードされたメモリアドレスを返す
* @else
* @brief Return an address of the memory where a symbol was loaded
* @endif
@@ -147,13 +188,25 @@
*/
void* DynamicLib::symbol(const char* symbol_name)
{
+#ifdef __RTP__
if (m_handle == NULL) return NULL;
return ::dlsym(m_handle, symbol_name);
+#else
+ if (!m_id) return NULL;
+ MODULE_INFO mi;
+ if (!moduleInfoGet(m_id, &mi)) return 0;
+ SymbolObj symbolObj;
+ symbolObj.name = const_cast<char*>(symbol_name);
+ symbolObj.group = mi.group;
+ symbolObj.addr = 0;
+ symEach(sysSymTbl, reinterpret_cast<FUNCPTR>(SymbolIterator), reinterpret_cast<int>(&symbolObj));
+ return symbolObj.addr;
+#endif
}
/*!
* @if jp
- * @brief ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹
+ * @brief エラーについての説明メッセージを返す
* @else
* @brief Return the explanation message about the error
* @endif
@@ -160,8 +213,25 @@
*/
const char* DynamicLib::error(void) const
{
+#ifdef __RTP__
return ::dlerror();
+#else
+ return "";
+#endif
}
+
+#ifndef __RTP__
+ extern "C" bool SymbolIterator(char* name, int val, SYM_TYPE type, int arg, UINT16 group)
+ {
+ SymbolObj* symbolObj = reinterpret_cast<SymbolObj*>(arg);
+ if (group == symbolObj->group && std::strcmp(name, symbolObj->name) == 0)
+ {
+ symbolObj->addr = reinterpret_cast<void*>(val);
+ return true;
+ }
+ else return false;
+ };
+#endif
};
/*!
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/DynamicLib.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -19,12 +19,21 @@
#ifndef COIL_DYNAMICLIB_H
#define COIL_DYNAMICLIB_H
+#ifdef __RTP__
#include <dlfcn.h>
+#define COIL_DEFAULT_DYNLIB_MODE RTLD_LAZY
+#else
+#include <moduleLib.h>
+#include <loadLib.h>
+#include <symLib.h>
+#define COIL_DEFAULT_DYNLIB_MODE LOAD_GLOBAL_SYMBOLS
+#endif
#include <string>
#include <coil/config_coil.h>
-#define COIL_DEFAULT_DYNLIB_MODE RTLD_LAZY
+
+
extern "C"
{
int ForExternTest(void);
@@ -36,7 +45,7 @@
* @if jp
*
* @class DynamicLib
- * @brief DynamicLib ¥¯¥é¥¹
+ * @brief DynamicLib クラス
*
* @else
*
@@ -52,11 +61,11 @@
/*!
* @if jp
*
- * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+ * @brief コンストラクタ
*
- * ¥³¥ó¥¹¥È¥é¥¯¥¿¡£
+ * コンストラクタ。
*
- * @param close_handle_on_destruction ¥¯¥í¡¼¥º¥Õ¥é¥°
+ * @param close_handle_on_destruction クローズフラグ
*
* @else
*
@@ -73,13 +82,13 @@
/*!
* @if jp
*
- * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+ * @brief コンストラクタ
*
- * ¥³¥ó¥¹¥È¥é¥¯¥¿¡£
+ * コンストラクタ。
*
- * @param dynlib_name ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê̾¾Î
- * @param open_mode ¥ª¡¼¥×¥ó¥â¡¼¥É
- * @param close_handle_on_destruction ¥¯¥í¡¼¥º¥Õ¥é¥°
+ * @param dynlib_name 動的リンクライブラリ名称
+ * @param open_mode オープンモード
+ * @param close_handle_on_destruction クローズフラグ
*
* @else
*
@@ -100,9 +109,9 @@
/*!
* @if jp
*
- * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+ * @brief デストラクタ
*
- * ¥Ç¥¹¥È¥é¥¯¥¿¡£
+ * デストラクタ。
*
* @else
*
@@ -117,11 +126,11 @@
/*!
* @if jp
*
- * @brief ¥³¥Ô¡¼¥³¥ó¥¹¥È¥é¥¯¥¿
+ * @brief コピーコンストラクタ
*
- * ¥³¥Ô¡¼¥³¥ó¥¹¥È¥é¥¯¥¿¡£
+ * コピーコンストラクタ。
*
- * @param rhs ¥³¥Ô¡¼¸µÆ°Åª¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¥ª¥Ö¥¸¥§¥¯¥È
+ * @param rhs コピー元動的リンクライブラリオブジェクト
*
* @else
*
@@ -138,13 +147,13 @@
/*!
* @if jp
*
- * @brief ÂåÆþ±é»»»Ò
+ * @brief 代入演算子
*
- * ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¥ª¥Ö¥¸¥§¥¯¥È¤ò¥³¥Ô¡¼¤¹¤ë¡£
+ * 動的リンクライブラリオブジェクトをコピーする。
*
- * @param rhs ÂåÆþ¸µÆ°Åª¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¥ª¥Ö¥¸¥§¥¯¥È
+ * @param rhs 代入元動的リンクライブラリオブジェクト
*
- * @return ÂåÆþ·ë²Ì
+ * @return 代入結果
*
* @else
*
@@ -163,15 +172,15 @@
/*!
* @if jp
*
- * @brief ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤Î¥í¡¼¥É
+ * @brief 動的リンクライブラリのロード
*
- * ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤¹¤ë¡£
+ * 動的リンクライブラリをロードする。
*
- * @param dll_name ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê̾¾Î
- * @param open_mode ¥ª¡¼¥×¥ó¥â¡¼¥É
- * @param close_handle_on_destruction ¥¯¥í¡¼¥º¥Õ¥é¥°
+ * @param dll_name 動的リンクライブラリ名称
+ * @param open_mode オープンモード
+ * @param close_handle_on_destruction クローズフラグ
*
- * @return 0: À®¸ù, -1: ¼ºÇÔ
+ * @return 0: 成功, -1: 失敗
*
* @else
*
@@ -194,11 +203,11 @@
/*!
* @if jp
*
- * @brief ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤Î¥¢¥ó¥í¡¼¥É
+ * @brief 動的リンクライブラリのアンロード
*
- * ưŪ¥ê¥ó¥¯¥é¥¤¥Ö¥é¥ê¤ò¥¢¥ó¥í¡¼¥É¤¹¤ë¡£
+ * 動的リンクライブラリをアンロードする。
*
- * @return 0: À®¸ù, -1: ¼ºÇÔ
+ * @return 0: 成功, -1: 失敗
*
* @else
*
@@ -215,13 +224,13 @@
/*!
* @if jp
*
- * @brief ¥·¥ó¥Ü¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤òÊÖ¤¹
+ * @brief シンボルがロードされたメモリアドレスを返す
*
- * ¥·¥ó¥Ü¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£
+ * シンボルがロードされたメモリアドレスを返す。
*
- * @param symbol_name ¥·¥ó¥Ü¥ë̾¾Î
+ * @param symbol_name シンボル名称
*
- * @return ¥á¥â¥ê¥¢¥É¥ì¥¹(NULL: ¼ºÇÔ)
+ * @return メモリアドレス(NULL: 失敗)
*
* @else
*
@@ -240,11 +249,11 @@
/*!
* @if jp
*
- * @brief ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹
+ * @brief エラーについての説明メッセージを返す
*
- * ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹¡£
+ * エラーについての説明メッセージを返す。
*
- * @return ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸(NULL: ¥¨¥é¡¼¤Ê¤·)
+ * @return エラーメッセージ(NULL: エラーなし)
*
* @else
*
@@ -261,9 +270,9 @@
/*!
* @if jp
*
- * @brief ¥æ¥Ë¥Ã¥È¥Æ¥¹¥È
+ * @brief ユニットテスト
*
- * ¥æ¥Ë¥Ã¥È¥Æ¥¹¥È¤ò¹Ô¤¦¡£
+ * ユニットテストを行う。
*
* @return 0xdeadbeef
*
@@ -283,9 +292,25 @@
std::string m_name;
int m_mode;
int m_closeflag;
+#ifdef __RTP__
void* m_handle;
+#else
+ int m_fd;
+ MODULE_ID m_id;
+#endif
int m_error;
};
+
+#ifndef __RTP__
+ typedef struct
+ {
+ const char* name;
+ int group;
+ void* addr;
+ }SymbolObj;
+
+ extern "C" bool SymbolIterator(char* name, int val, SYM_TYPE type, int arg, UINT16 group);
+#endif
};
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/File.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/File.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/File.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -22,16 +22,13 @@
#include <cstring>
#include <sys/types.h>
#include <dirent.h>
-#include <libgen.h>
+
#include <coil/config_coil.h>
#include <coil/stringutil.h>
-#ifdef __QNX__
-using std::strlen;
-using std::strcpy;
-#endif
+
namespace coil
{
@@ -60,10 +57,7 @@
*/
inline std::string dirname(char* path)
{
- char path_name[strlen(path)+1];
- strcpy(path_name, path);
- std::string dir_name = ::dirname(path);
- return dir_name;
+ return "";
}
/*!
@@ -91,10 +85,8 @@
*/
inline std::string basename(const char* path)
{
- char path_name[strlen(path)+1];
- strcpy(path_name, path);
- std::string base_name = ::basename(path_name);
- return base_name;
+
+ return "";
}
/*!
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/OS.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/OS.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/OS.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -20,7 +20,10 @@
#define COIL_OS_H
#include <string>
+
+#if defined(__RTP__)
#include <sys/utsname.h>
+#endif
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
@@ -55,11 +58,13 @@
*
* @endif
*/
+#if defined(__RTP__)
typedef ::utsname utsname;
inline int uname(utsname* name)
{
return ::uname(name);
}
+#endif
/*!
* @if jp
@@ -80,7 +85,7 @@
*
* @endif
*/
- typedef ::pid_t pid_t;
+ typedef wind_rtp* pid_t;
inline pid_t getpid()
{
return ::getpid();
@@ -105,10 +110,12 @@
*
* @endif
*/
+#if defined(__RTP__)
inline pid_t getppid()
{
return ::getppid();
}
+#endif
/*!
* @if jp
@@ -180,9 +187,6 @@
: optarg(::optarg), optind(1), opterr(1), optopt(0), m_argc(argc), m_argv(argv), m_opt(opt), m_flag(flag)
{
::optind = 1;
-#ifdef __QNX___
- optind_last = 1;
-#endif
}
/*!
@@ -203,9 +207,6 @@
~GetOpt()
{
::optind = 1;
-#ifdef __QNX__
- optind_last = 1;
-#endif
}
/*!
@@ -230,27 +231,12 @@
int operator()()
{
::opterr = opterr;
-#ifndef __QNX__
::optind = optind;
-#else
- ::optind = optind_last;
- ::optarg = 0;
-#endif
int result = getopt(m_argc, m_argv, m_opt);
-#ifdef __QNX__
- if(::optind == optind_last)
- {
- ::optind++;
- result = getopt(m_argc, m_argv, m_opt);
- optind_last = ::optind;
- }
-#endif
+
optarg = ::optarg;
optind = ::optind;
optopt = ::optopt;
-#if __QNX__
- if(optind_last < m_argc) { ++optind_last; }
-#endif
return result;
}
@@ -258,9 +244,6 @@
int optind; //! ½èÍýÂоݰú¿ô
int opterr; //! ¥¨¥é¡¼É½¼¨ 0:Í޻ߡ¢1:ɽ¼¨
int optopt; //! ¥ª¥×¥·¥ç¥óʸ»ú¤¬Â¤ê¤Ê¤¤»þ¡¢Â¿¤¤»þ¤Ë¥»¥Ã¥È¤µ¤ì¤ë
-#ifdef __QNX__
- int optind_last;
-#endif
private:
int m_argc;
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include <libgen.h>
+
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -33,7 +33,7 @@
/*!
* @if jp
- * @brief ¥×¥í¥»¥¹¤òµ¯Æ°¤¹¤ë
+ * @brief プロセスを起動する
* @else
* @brief Launching a process
* @endif
@@ -40,43 +40,13 @@
*/
int launch_shell(std::string command)
{
- signal(SIGCHLD, SIG_IGN);
- pid_t pid;
- if((pid = fork()) < 0 )
- { // fork failed
- return -1;
- }
-
- if (pid == 0) // I'm child process
- {
- // signal(SIGCHLD, SIG_IGN);
- // signal(SIGALRM, SIG_IGN);
- // signal(SIGHUP , SIG_IGN);
- // signal(SIGPIPE, SIG_IGN);
- // signal(SIGTERM, SIG_IGN);
- setsid();
- // close(0);
- // close(1);
- // close(2);
- // open("/dev/null", O_RDWR);
- // dup2(0, 1);
- // dup2(0, 2);
- // umask(0);
-
- coil::vstring vstr(::coil::split(command, " "));
- char* const * argv = ::coil::toArgv(vstr);
-
- execvp(vstr.front().c_str(), argv);
-
- return -1;
- }
- return 0;
+ return -1;
}
int daemon(int nochdir, int noclose)
{
- return daemon(nochdir, noclose);
+ return -1;
}
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Process.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
-#include <libgen.h>
+
#include <coil/stringutil.h>
namespace coil
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Routing.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Routing.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Routing.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -27,11 +27,15 @@
#include <coil/stringutil.h>
#include <coil/config_coil.h>
+#ifndef __RTP__
+#include <wrapper/wrapperHostLib.h>
+#endif
+
namespace coil
{
/*!
* @if jp
- * @brief °¸À襢¥É¥ì¥¹¤«¤éÍøÍѤµ¤ì¤ë¥¨¥ó¥É¥Ý¥¤¥ó¥È¥¢¥É¥ì¥¹¤òÆÀ¤ë
+ * @brief 宛先アドレスから利用されるエンドポイントアドレスを得る
* @else
* @brief Getting network interface name from destination address
* @endif
@@ -48,7 +52,7 @@
/*!
* @if jp
- * @brief °¸À襢¥É¥ì¥¹¤«¤éÍøÍѤµ¤ì¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾¤òÆÀ¤ë
+ * @brief 宛先アドレスから利用されるネットワークインターフェース名を得る
* @else
* @brief Getting network interface name from destination address
* @endif
@@ -55,26 +59,20 @@
*/
bool find_dest_ifname(std::string dest_addr, std::string& dest_if)
{
+#ifdef __RTP__
// This logic should be replaced by direct retrieving using
// routing interface like AFROUTE or sysctl.
struct ::hostent *hostent;
struct ::sockaddr_in addr;
+
hostent = gethostbyname(dest_addr.c_str());
addr.sin_addr.s_addr = **(unsigned int **)(hostent->h_addr_list);
dest_addr = inet_ntoa(addr.sin_addr);
-#if defined(COIL_OS_FREEBSD) || defined(COIL_OS_DARWIN) || defined(COIL_OS_CYGWIN) || defined(COIL_OS_QNX)
+
+
std::string cmd("PATH=/bin:/sbin:/usr/bin:/usr/sbin "
- "route get ");
- const char* match_str = "interface";
- const char* delimiter = ":";
- size_t ifname_pos(1);
- cmd += dest_addr;
- cmd += " 2> /dev/null";
-#endif // COIL_OS_IS_FREEBSD || COIL_OS_DARWIN || COIL_OS_CYGWIN || COIL_OS_QNX
-#if defined(COIL_OS_LINUX)
- std::string cmd("PATH=/bin:/sbin:/usr/bin:/usr/sbin "
"ip route get ");
const char* match_str = "dev ";
const char* delimiter = " ";
@@ -81,7 +79,7 @@
size_t ifname_pos(2);
cmd += dest_addr;
cmd += " 2> /dev/null";
-#endif // COIL_OS_IS_LINUX
+
FILE* fp;
if ((fp = popen(cmd.c_str(), "r")) == NULL)
@@ -100,16 +98,8 @@
line.erase(line.end() - 1);
coil::vstring vs(coil::split(line, delimiter));
-#if defined(COIL_OS_FREEBSD) || defined(COIL_OS_DARWIN) || defined(COIL_OS_CYGWIN) || defined(COIL_OS_QNX)
- if (vs.size() > ifname_pos)
- {
- dest_if = vs[ifname_pos];
- pclose(fp);
- wait(NULL);
- return true;
- }
-#endif // COIL_OS_FREEBSD || COIL_OS_DARWIN || COIL_OS_CYGWIN || COIL_OS_QNX
-#if defined(COIL_OS_LINUX)
+
+
for (int i(0); i < vs.size(); ++i)
{
if (vs[i] == "dev")
@@ -119,16 +109,17 @@
return true;
}
}
-#endif // COIL_OS_LINUX
+
} while (!feof(fp));
pclose(fp);
wait(NULL);
+#endif
return false;
}
/*!
* @if jp
- * @brief ¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹Ì¾¤«¤éIP¥¢¥É¥ì¥¹¤òÆÀ¤ë
+ * @brief ネットワークインターフェース名からIPアドレスを得る
* @else
* @brief Get IP address from a network interface name
* @endif
@@ -135,11 +126,13 @@
*/
bool ifname_to_ipaddr(std::string ifname, std::string& ipaddr)
{
+#ifdef __RTP__
std::string cmd("ifconfig ");
cmd += ifname;
cmd += " 2> /dev/null";
FILE* fp;
+
if ((fp = popen(cmd.c_str(), "r")) == NULL)
{
return false;
@@ -166,6 +159,8 @@
} while (!feof(fp));
pclose(fp);
wait(NULL);
+#else
+#endif
return false;
}
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -21,15 +21,13 @@
#include <coil/Signal.h>
#include <string.h>
-#ifdef COIL_OS_FREEBSD
-#define _SIGSET_NWORDS _SIG_WORDS
-#endif
+
namespace coil
{
/*!
* @if jp
- * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
+ * @brief コンストラクタ
* @else
* @brief Constructor
* @endif
@@ -41,9 +39,9 @@
/*!
* @if jp
- * @brief ¥³¥ó¥¹¥È¥é¥¯¥¿
- * @param handle ¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é
- * @param signum ¥·¥°¥Ê¥ëÈÖ¹æ
+ * @brief コンストラクタ
+ * @param handle シグナルハンドラ
+ * @param signum シグナル番号
* @else
* @brief Constructor
* @param handle Signal handler.
@@ -70,7 +68,7 @@
/*!
* @if jp
- * @brief ¥Ç¥¹¥È¥é¥¯¥¿
+ * @brief デストラクタ
* @else
* @brief Destructor
* @endif
@@ -85,3 +83,5 @@
}
};
+
+
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Signal.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -20,6 +20,9 @@
#ifndef COIL_SIGNAL_H
#define COIL_SIGNAL_H
+#ifndef __RTP__
+#include <vxWorks.h>
+#endif
#include <signal.h>
namespace coil
@@ -109,4 +112,5 @@
};
};
+
#endif // COIL_SIGNAL_H
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Time.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Time.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/Time.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -20,7 +20,12 @@
#define COIL_TIME_H
#include <unistd.h>
+#if defined(VXWORKS_66) && !defined(__RTP__)
+#include <timers.h>
+#else
#include <sys/time.h>
+#endif
+
#include <sys/types.h>
#include <time.h>
#include <iostream>
@@ -27,18 +32,22 @@
#include <coil/config_coil.h>
#include <coil/TimeValue.h>
+#ifndef __RTP__
+#include <selectLib.h>
+#endif
+
namespace coil
{
/*!
* @if jp
- * @brief »ØÄꤵ¤ì¤¿Éô֤ϽèÍý¤òµÙ»ß¤¹¤ë
+ * @brief 指定された秒間は処理を休止する
*
- * »ØÄꤵ¤ì¤¿Éô֤ϽèÍý¤òµÙ»ß¤¹¤ë¡£
+ * 指定された秒間は処理を休止する。
*
- * @param seconds Éÿô
+ * @param seconds 秒数
*
- * @return 0: À®¸ù, >0: ¼ºÇÔ
+ * @return 0: 成功, >0: 失敗
*
* @else
* @brief Stop a processing at specified second time
@@ -58,13 +67,13 @@
/*!
* @if jp
- * @brief »ØÄꤵ¤ì¤¿Éô֤ϽèÍý¤òµÙ»ß¤¹¤ë
+ * @brief 指定された秒間は処理を休止する
*
- * »ØÄꤵ¤ì¤¿Éô֤ϽèÍý¤òµÙ»ß¤¹¤ë¡£
+ * 指定された秒間は処理を休止する。
*
- * @param interval TimeValue¥ª¥Ö¥¸¥§¥¯¥È
+ * @param interval TimeValueオブジェクト
*
- * @return 0: À®¸ù, >0: ¼ºÇÔ
+ * @return 0: 成功, >0: 失敗
*
* @else
* @brief Stop a processing at specified second time
@@ -87,13 +96,13 @@
/*!
* @if jp
- * @brief »ØÄꤵ¤ì¤¿¥Þ¥¤¥¯¥íÉô֤ϽèÍý¤òµÙ»ß¤¹¤ë
+ * @brief 指定されたマイクロ秒間は処理を休止する
*
- * »ØÄꤵ¤ì¤¿¥Þ¥¤¥¯¥íÉô֤ϽèÍý¤òµÙ»ß¤¹¤ë¡£
+ * 指定されたマイクロ秒間は処理を休止する。
*
- * @param usec ¥Þ¥¤¥¯¥íÉÿô
+ * @param usec マイクロ秒数
*
- * @return 0: À®¸ù, -1: ¼ºÇÔ
+ * @return 0: 成功, -1: 失敗
*
* @else
* @brief Stop a processing at specified micro second time
@@ -106,21 +115,22 @@
*
* @endif
*/
- inline int usleep(useconds_t usec)
+ inline int usleep(unsigned int usec)
{
- return ::usleep(usec);
+ struct timespec req = {0,usec * 1000};
+ return ::nanosleep(&req, NULL);
}
/*!
* @if jp
- * @brief »þ¹ï¤È¥¿¥¤¥à¥¾¡¼¥ó¤ò¼èÆÀ¤¹¤ë
+ * @brief 時刻とタイムゾーンを取得する
*
- * »þ¹ï¤È¥¿¥¤¥à¥¾¡¼¥ó¤ò¼èÆÀ¤¹¤ë¡£
+ * 時刻とタイムゾーンを取得する。
*
- * @param tv »þ¹ï¹½Â¤ÂÎ
- * @param tz ¥¿¥¤¥à¥¾¡¼¥ó¹½Â¤ÂÎ
+ * @param tv 時刻構造体
+ * @param tz タイムゾーン構造体
*
- * @return 0: À®¸ù, -1: ¼ºÇÔ
+ * @return 0: 成功, -1: 失敗
*
* @else
* @brief Get the time and timezone
@@ -134,18 +144,25 @@
*
* @endif
*/
+#if defined(VXWORKS_66) && !defined(__RTP__)
+ inline int gettimeofday(struct timespec *tv)
+ {
+ return ::clock_gettime(CLOCK_REALTIME, tv);
+ }
+#else
inline int gettimeofday(struct timeval *tv, struct timezone *tz)
{
return ::gettimeofday(tv, tz);
}
+#endif
/*!
* @if jp
- * @brief »þ¹ï¤ò¼èÆÀ¤¹¤ë
+ * @brief 時刻を取得する
*
- * »þ¹ï¤ò¼èÆÀ¤¹¤ë¡£
+ * 時刻を取得する。
*
- * @return TimeValue¥ª¥Ö¥¸¥§¥¯¥È
+ * @return TimeValueオブジェクト
*
* @else
* @brief Get the time
@@ -158,21 +175,30 @@
*/
inline TimeValue gettimeofday()
{
+#if defined(VXWORKS_66) && !defined(__RTP__)
+ timespec tv;
+ ::clock_gettime(CLOCK_REALTIME, &tv);
+ return TimeValue(tv.tv_sec, tv.tv_nsec/1000);
+#else
timeval tv;
::gettimeofday(&tv, 0);
return TimeValue(tv.tv_sec, tv.tv_usec);
+#endif
+
}
+
+
/*!
* @if jp
- * @brief »þ¹ï¤È¥¿¥¤¥à¥¾¡¼¥ó¤òÀßÄꤹ¤ë
+ * @brief 時刻とタイムゾーンを設定する
*
- * »þ¹ï¤È¥¿¥¤¥à¥¾¡¼¥ó¤òÀßÄꤹ¤ë¡£
+ * 時刻とタイムゾーンを設定する。
*
- * @param tv »þ¹ï¹½Â¤ÂÎ
- * @param tz ¥¿¥¤¥à¥¾¡¼¥ó¹½Â¤ÂÎ
+ * @param tv 時刻構造体
+ * @param tz タイムゾーン構造体
*
- * @return 0: À®¸ù, -1: ¼ºÇÔ
+ * @return 0: 成功, -1: 失敗
*
* @else
* @brief Set the time and timezone
@@ -186,10 +212,17 @@
*
* @endif
*/
- inline int settimeofday(const struct timeval *tv , const struct timezone *tz)
+#if defined(VXWORKS_66) && !defined(__RTP__)
+ inline int settimeofday(struct timespec *tv)
{
+ return ::clock_settime(CLOCK_REALTIME, tv);
+ }
+#else
+ inline int settimeofday(struct timeval *tv , struct timezone *tz)
+ {
return ::settimeofday(tv, tz);
}
+#endif
};
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -1,14 +1,13 @@
// -*- C++ -*-
/*!
- * @file MutexPosix.h
- * @brief RT-Middleware Service interface
+ * @file UUID.h
+ * @brief UUID Generator for VxWorks
* @date $Date$
- * @author Noriaki Ando <n-ando at aist.go.jp>
+ * @author Nobuhiko Miyamoto <n-miyamoto at aist.go.jp>
*
- * Copyright (C) 2008
- * Noriaki Ando
- * Task-intelligence Research Group,
- * Intelligent Systems Research Institute,
+ * Copyright (C) 2017
+ * Nobuhiko Miyamoto
+ * Robot Innovation Research Center
* National Institute of
* Advanced Industrial Science and Technology (AIST), Japan
* All rights reserved.
@@ -21,108 +20,111 @@
#include <iostream>
#include <string.h>
-#ifdef COIL_OS_FREEBSD
-void error_code(uint32_t status)
-{
- if (status == uuid_s_ok)
- std::cout << "uuid_s_ok" << std::endl;
- else if (status == uuid_s_bad_version)
- std::cout << "uuid_s_bad_version" << std::endl;
- else if (status == uuid_s_invalid_string_uuid)
- std::cout << "uuid_s_invalid_string_uuid" << std::endl;
- else if (status == uuid_s_no_memory)
- std::cout << "uuid_s_no_memory" << std::endl;
- else
- std::cout << "other error" << std::endl;
-}
+#if defined(VXWORKS_66) && !defined(__RTP__)
+#include <timers.h>
+#else
+#include <sys/time.h>
+#endif
-void uuid_clear(uuid_t& uu)
-{
- uint32_t status;
- uuid_create_nil(&uu, &status);
-}
-void uuid_unparse(uuid_t& uu, char*& uuidstr)
-{
- uint32_t status;
- uuid_to_string(&uu, &uuidstr, &status);
-}
-void uuid_generate(uuid_t& out)
-{
- uint32_t status;
- uuid_create(&out, &status);
-}
+#include <coil/TimeValue.h>
+#include <coil/Time.h>
+
+#ifndef __RTP__
+#include <muxLib.h>
#endif
+
namespace coil
{
-#ifdef COIL_OS_FREEBSD
- UUID::UUID()
- : m_uuidstr(0)
- {
- ::uuid_clear(m_uuid);
- }
- UUID::UUID(const uuid_t& uuid)
- : m_uuid(uuid), m_uuidstr(0)
- {
- }
- UUID::~UUID()
- {
- free(m_uuidstr);
- }
- const char* UUID::to_string()
- {
- uuid_unparse(m_uuid, m_uuidstr);
- return m_uuidstr;
- }
-
- UUID_Generator::UUID_Generator()
- {
- }
- UUID_Generator::~UUID_Generator()
- {
- }
- void UUID_Generator::init()
+ uuid_t::uuid_t()
{
+ time_low = 0;
+ time_mid = 0;
+ time_hi_version = 0;
+ clock_seq_low = 0;
+ clock_seq_hi_variant = 0;
+ node_low = 0;
+ node_high = 0;
}
-
- UUID* UUID_Generator::generateUUID(int n, int h)
- {
- uuid_t uuid;
- uuid_generate(uuid);
- return new UUID(uuid);
- }
-#endif
-
-#if defined(COIL_OS_LINUX) || defined(COIL_OS_DARWIN) || defined(COIL_OS_CYGWIN)
-
UUID_Generator::UUID_Generator(){}
void UUID_Generator::init(){}
- UUID* UUID_Generator::generateUUID(int varsion, int variant){
+ UUID* UUID_Generator::generateUUID(int version, int variant){
uuid_t uuid;
+ //timeval tv;
+ //::gettimeofday(&tv, 0);
+ coil::TimeValue tv = coil::gettimeofday();
- uuid_generate(uuid);
+
+ //uint64_t timestamp = ((long long)tv.tv_sec*10000000LL + (long long)tv.tv_usec/100LL) + 0x01b21dd213814000LL;
+ uint64_t timestamp = ((uint64_t)tv.sec()*10000000LL + (uint64_t)tv.usec()/100LL) + 0x01b21dd213814000LL;
+ srand(tv.sec() + tv.usec());
+ uint64_t clock_seq = rand() * (1E14+ 1.0) / (1.0 + RAND_MAX);
+
+ uuid.time_low = timestamp & 0xffffffffL;
+ uuid.time_mid = (timestamp >> 32L) & 0xffffL;
+ uuid.time_hi_version = ((timestamp >> 48L) & 0x0fffL) | version << 12L;
+ uuid.clock_seq_low = clock_seq & 0xffL;
+ uuid.clock_seq_hi_variant = (clock_seq >> 8L) & 0x3fL;
+
+#if defined(__RTP__) || defined(VXWORKS_66)
+ uint64_t node = rand() * (281474976710655LL + 1.0) / (1.0 + RAND_MAX);
+#else
+ char mData[6];
+ PROTO_COOKIE muxCookie = muxBind ("eth0",1,NULL,NULL,NULL,NULL,MUX_PROTO_SNARF,"IEEE802.2 LLC",NULL);
+ muxIoctl(muxCookie, EIOCGADDR, mData);
+ uint64_t node = (uint64_t)mData[0] + ((uint64_t)mData[1] >> 8) + ((uint64_t)mData[2] >> 16) + ((uint64_t)mData[3] >> 24) + ((uint64_t)mData[4] >> 32) + ((uint64_t)mData[5] >> 40);
+#endif
+ uuid.node_low = node & 0xffffffffL;
+ uuid.node_high = (node >> 32L) & 0xffffL;
+
+
+
return new UUID(&uuid);
}
+
+
UUID::UUID(){
- uuid_clear(this->_uuid);
+
}
UUID::UUID(uuid_t *uuid){
- strncpy((char *)this->_uuid, (char *)(*uuid), sizeof(this->_uuid));
+ _uuid.time_low = uuid->time_low;
+ _uuid.time_mid = uuid->time_mid;
+ _uuid.time_hi_version = uuid->time_hi_version;
+ _uuid.clock_seq_low = uuid->clock_seq_low;
+ _uuid.clock_seq_hi_variant = uuid->clock_seq_hi_variant;
+
+ _uuid.node_low = uuid->node_low;
+ _uuid.node_high = uuid->node_high;
}
- const char* UUID::to_string(){
- uuid_unparse(this->_uuid, buf);
- return buf;
+ const char* UUID::to_string()
+ {
+ std::string result;
+
+ result += StringToUUID<uint32_t>(_uuid.time_low,8);
+ result += "-";
+ result += StringToUUID<uint16_t>(_uuid.time_mid,4);
+ result += "-";
+ result += StringToUUID<uint16_t>(_uuid.time_hi_version,4);
+ result += "-";
+ result += StringToUUID<uint8_t>(_uuid.clock_seq_low,2);
+ result += StringToUUID<uint8_t>(_uuid.clock_seq_hi_variant,2);
+ result += "-";
+ result += StringToUUID<uint32_t>(_uuid.node_low,8);
+ result += StringToUUID<uint16_t>(_uuid.node_high,4);
+
+ return result.c_str();
}
-#endif
+
+
};
Modified: trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/coil/vxworks/coil/UUID.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -1,14 +1,13 @@
// -*- C++ -*-
/*!
- * @file MutexPosix.h
- * @brief RT-Middleware Service interface
+ * @file UUID.h
+ * @brief UUID Generator for VxWorks
* @date $Date$
- * @author Noriaki Ando <n-ando at aist.go.jp>
+ * @author Nobuhiko Miyamoto <n-miyamoto at aist.go.jp>
*
- * Copyright (C) 2008
- * Noriaki Ando
- * Task-intelligence Research Group,
- * Intelligent Systems Research Institute,
+ * Copyright (C) 2017
+ * Nobuhiko Miyamoto
+ * Robot Innovation Research Center
* National Institute of
* Advanced Industrial Science and Technology (AIST), Japan
* All rights reserved.
@@ -21,38 +20,46 @@
#define COIL_UUID_H
#include <coil/config_coil.h>
-#ifdef COIL_OS_FREEBSD
-#include <uuid.h>
+#include <stdlib.h>
+#include <sstream>
+#include <vxWorks.h>
+
+
+
+
namespace coil
{
- class UUID
- {
+ class uuid_t {
public:
- UUID();
- UUID(const uuid_t& uuid);
- ~UUID();
- const char* to_string();
- private:
- uuid_t m_uuid;
- char* m_uuidstr;
+ uuid_t();
+ uint32_t time_low;
+ uint16_t time_mid;
+ uint16_t time_hi_version;
+ uint8_t clock_seq_low;
+ uint8_t clock_seq_hi_variant;
+ uint32_t node_low;
+ uint16_t node_high;
};
- class UUID_Generator
+ template <typename DataType>
+ std::string StringToUUID(DataType v, unsigned int size)
{
- public:
- UUID_Generator();
- ~UUID_Generator();
- void init();
- coil::UUID* generateUUID(int n, int h);
- };
-};
-#endif
-#if defined(COIL_OS_LINUX) || defined(COIL_OS_DARWIN) || defined(COIL_OS_CYGWIN)
-#include <uuid/uuid.h>
-namespace coil
-{
+ std::stringstream stream;
+ stream << std::hex << v;
+ std::string ret(stream.str());
+
+ if(ret.size() < size)
+ {
+ for(unsigned int i=ret.size();i < size;i++)
+ {
+ ret = "0" + ret;
+ }
+ }
+ return ret;
+ }
+
class UUID
{
uuid_t _uuid;
@@ -72,6 +79,6 @@
UUID* generateUUID(int n, int h);
};
};
-#endif
+
#endif // COIL_UUID_H
Added: trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt (rev 0)
+++ trunk/OpenRTM-aist/src/lib/rtm/CMakeLists.txt 2017-05-30 09:47:01 UTC (rev 2994)
@@ -0,0 +1,131 @@
+cmake_minimum_required (VERSION 2.6)
+project (rtm)
+
+set(ORB_ROOT ${ORB_ROOT} CACHE STRING "set ORB_ROOT")
+
+add_subdirectory(idl)
+
+
+
+if(RTP)
+ link_directories(${ORB_ROOT}/target/ppc_8xx-vxworks_6.6/gcc_4.1.2_Rp/config_rt_fast/lib)
+ include_directories(${ORB_ROOT}/target/ppc_8xx-vxworks_6.6/gcc_4.1.2_Rp/config_rt_fast/include)
+ set(ORB_LIBRARIES OEtcp OEmirror OEbridge OEudp OEipmc OEshrmem OEudp OEorb )
+
+else(RTP)
+
+ link_directories(${ORB_ROOT}/target/ppc_8xx-vxworks_6.6/gcc_4.1.2_ExLcRi/config_rt_full/lib)
+ include_directories(${ORB_ROOT}/target/ppc_8xx-vxworks_6.6/gcc_4.1.2_ExLcRi/config_rt_full/include)
+
+
+ link_directories(${ORB_ROOT}/target/ppc_8xx-vxworks_6.6/gcc_4.1.2_ExLcRi/config_rt_full/OENames_2.1.6/lib)
+ include_directories(${ORB_ROOT}/target/ppc_8xx-vxworks_6.6/gcc_4.1.2_ExLcRi/config_rt_full/OENames_2.1.6/include)
+
+ set(ORB_LIBRARIES OEtcp OEmirror OEbridge OEudp OEipmc OEshrmem OEudp OEorb )
+
+endif()
+
+
+
+
+#ADD_DEFINITIONS (-DORB_IS_ORBEXPRESS)
+ADD_DEFINITIONS("-Wpointer-arith -Wwrite-strings -Waggregate-return -Wredundant-decls -Wno-unused -Wshadow -Wundef -Wold-style-cast -fno-implement-inlines -fvolatile -ansi -msoft-float ")
+
+#ADD_DEFINITIONS(-DCORBA_ANY_SHARED_PTR_OPERATORS -DINCLUDE_CORBA_CORBALOC)
+
+
+
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/coil/common
+ ${CMAKE_SOURCE_DIR}/coil/vxworks
+ ${PROJECT_BINARY_DIR}/..
+ )
+
+
+
+set(rtm_srcs
+ ConfigAdmin.cpp
+ ModuleManager.cpp
+ CorbaNaming.cpp
+ NVUtil.cpp
+ ManagerActionListener.cpp
+ LocalServiceAdmin.cpp
+ Factory.cpp
+ PublisherPeriodic.cpp
+ ECFactory.cpp
+ OutPortCorbaCdrConsumer.cpp
+ PeriodicExecutionContext.cpp
+ InPortPushConnector.cpp
+ CORBA_IORUtil.cpp
+ ManagerServant.cpp
+ OpenHRPExecutionContext.cpp
+ RTObjectStateMachine.cpp
+ InPortProvider.cpp
+ PortConnectListener.cpp
+ DefaultPeriodicTask.cpp
+ NamingManager.cpp
+ OutPortCorbaCdrProvider.cpp
+ InPortDirectProvider.cpp
+ PortBase.cpp
+ OutPortProvider.cpp
+ ExecutionContextProfile.cpp
+ PublisherFlush.cpp
+ OutPortPushConnector.cpp
+ CorbaPort.cpp
+ SdoConfiguration.cpp
+ RTObject.cpp
+ DataFlowComponentBase.cpp
+ ManagerConfig.cpp
+ SystemLogger.cpp
+ ExecutionContextWorker.cpp
+ ExecutionContextBase.cpp
+ ExtTrigExecutionContext.cpp
+ InPortBase.cpp
+ SdoOrganization.cpp
+ PortAdmin.cpp
+ InPortPullConnector.cpp
+ ConfigurationListener.cpp
+ OutPortPullConnector.cpp
+ LogstreamFile.cpp
+ RTCUtil.cpp
+ CdrRingBuffer.cpp
+ InPortCorbaCdrProvider.cpp
+ ConnectorListener.cpp
+ PeriodicECSharedComposite.cpp
+ PublisherNew.cpp
+ ComponentActionListener.cpp
+ InPortDirectConsumer.cpp
+ OutPortBase.cpp
+ Manager.cpp
+ InPortCorbaCdrConsumer.cpp
+ FactoryInit.cpp
+ SdoServiceAdmin.cpp
+)
+
+
+
+
+
+add_executable(rtm rtcd.cpp TestRTC.cpp ${rtm_srcs} ${ALL_IDL_SRCS})
+#add_library(rtm STATIC ${rtm_srcs} ${ALL_IDL_SRCS} )
+
+set_source_files_properties(${ALL_IDL_SRCS} PROPERTIES GENERATED 1)
+
+if(NOT TARGET ALL_IDL_TGT)
+ add_custom_target(ALL_IDL_TGT)
+
+endif(NOT TARGET ALL_IDL_TGT)
+add_dependencies(rtm coil)
+add_dependencies(rtm ALL_IDL_TGT)
+
+
+
+
+
+target_link_libraries(rtm ${ORB_LIBRARIES} coil)
+
+
+
+
Modified: trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -23,6 +23,7 @@
#define TRANSIENT_SUFFIX_SEP '\xfe'
#define TRANSIENT_SUFFIX_SIZE 8
+
namespace CORBA_IORUtil
{
@@ -31,7 +32,7 @@
typedef _CORBA_Unbounded_Sequence_String StringUSequence;
#endif
-#ifndef ORB_IS_RTORB
+#if not defined(ORB_IS_RTORB) && not defined(ORB_IS_ORBEXPRESS)
// prototype of static functions
static void print_key(std::stringstream& s, OctetUSequence& key);
@@ -52,6 +53,7 @@
* @brief Convert from IOR string to IOR structure
* @endif
*/
+#ifndef ORB_IS_ORBEXPRESS
bool toIOR(const char* iorstr, IOP::IOR& ior)
{
#ifndef ORB_IS_RTORB
@@ -110,6 +112,7 @@
return false;
#endif // ORB_IS_RTORB
}
+#endif //ORB_IS_ORBEXPRESS
/*!
* @if jp
@@ -118,6 +121,7 @@
* @brief Convert from IOR structure to IOR string
* @endif
*/
+#ifndef ORB_IS_ORBEXPRESS
bool toString(IOP::IOR& ior, std::string& iorstr)
{
#ifndef ORB_IS_RTORB
@@ -170,6 +174,7 @@
return false;
#endif // ORB_IS_RTORB
}
+#endif //ORB_IS_ORBEXPRESS
/*!
* @if jp
@@ -180,7 +185,7 @@
*/
bool replaceEndpoint(std::string& iorstr, const std::string& endpoint)
{
-#ifndef ORB_IS_RTORB
+#if not defined(ORB_IS_RTORB) && not defined(ORB_IS_ORBEXPRESS)
try
{
IOP::IOR ior;
@@ -226,7 +231,7 @@
std::string formatIORinfo(const char* iorstr)
{
std::stringstream retstr;
-#ifndef ORB_IS_RTORB
+#if not defined(ORB_IS_RTORB) && not defined(ORB_IS_ORBEXPRESS)
IOP::IOR ior;
toIOR(iorstr, ior);
@@ -282,13 +287,13 @@
}
}
#else // ORB_IS_RTORB
- retstr << "RtORB does't support formatIORinfo() function." << std::endl;
+ retstr << "RtORB and ORBexpress does't support formatIORinfo() function." << std::endl;
#endif // ORB_IS_RTORB
return retstr.str();
}
-#ifndef ORB_IS_RTORB
+#if not defined(ORB_IS_RTORB) && not defined(ORB_IS_ORBEXPRESS)
//------------------------------------------------------------
// static functions
@@ -430,3 +435,4 @@
}
#endif // ORB_IS_RTORB
};
+
Modified: trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/CORBA_IORUtil.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -19,6 +19,9 @@
#define CORBA_IORUTIL_H
#include <rtm/RTC.h>
+#ifdef ORB_IS_ORBEXPRESS
+#include <IOP.h>
+#endif
/*!
* @if jp
@@ -35,6 +38,7 @@
*
* @endif
*/
+
namespace CORBA_IORUtil
{
/*!
@@ -46,7 +50,9 @@
*
* @endif
*/
+#ifndef ORB_IS_ORBEXPRESS
bool toIOR(const char* iorstr, IOP::IOR& ior);
+#endif
/*!
* @if jp
@@ -57,7 +63,9 @@
*
* @endif
*/
+#ifndef ORB_IS_ORBEXPRESS
bool toString(IOP::IOR& ior, std::string& iorstr);
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/CORBA_SeqUtil.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CORBA_SeqUtil.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/CORBA_SeqUtil.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -139,7 +139,11 @@
* @endif
*/
template <class CorbaSequence, class Functor>
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Long find(CorbaSequence& seq, Functor f)
+#else
CORBA::Long find(const CorbaSequence& seq, Functor f)
+#endif
{
CORBA::ULong len(seq.length());
for (CORBA::ULong i = 0; i < len; ++i)
Modified: trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ConnectorListener.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -27,7 +27,12 @@
#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
{
@@ -258,6 +263,8 @@
*/
virtual void operator()(const ConnectorInfo& info,
const cdrMemoryStream& data) = 0;
+
+
};
/*!
@@ -327,7 +334,11 @@
const cdrMemoryStream& cdrdata)
{
DataType data;
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Stream cdr(&cdrdata.read_octet(), cdrdata.size_written());
+#else
cdrMemoryStream cdr(cdrdata.bufPtr(), cdrdata.bufSize());
+#endif
// endian type check
std::string endian_type;
@@ -335,8 +346,20 @@
"little");
coil::normalize(endian_type);
std::vector<std::string> endian(coil::split(endian_type, ","));
+
+#ifdef ORB_IS_ORBEXPRESS
if (endian[0] == "little")
{
+ cdr.is_little_endian(true);
+ }
+ else if (endian[0] == "big")
+ {
+ cdr.is_little_endian(false);
+ }
+ cdr >> data;
+#else
+ if (endian[0] == "little")
+ {
cdr.setByteSwapFlag(true);
}
else if (endian[0] == "big")
@@ -344,6 +367,12 @@
cdr.setByteSwapFlag(false);
}
data <<= cdr;
+#endif
+
+
+
+
+
this->operator()(info, data);
}
Modified: trunk/OpenRTM-aist/src/lib/rtm/CorbaConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CorbaConsumer.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/CorbaConsumer.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -122,7 +122,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ CorbaConsumerBase(CorbaConsumerBase& x)
+#else
CorbaConsumerBase(const CorbaConsumerBase& x)
+#endif
: m_objref(CORBA::Object::_duplicate(x.m_objref))
{
}
@@ -146,7 +150,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ CorbaConsumerBase& operator=(CorbaConsumerBase& x)
+#else
CorbaConsumerBase& operator=(const CorbaConsumerBase& x)
+#endif
{
CorbaConsumerBase tmp(x);
tmp.swap(*this);
@@ -367,7 +375,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ CorbaConsumer(CorbaConsumer& x)
+#else
CorbaConsumer(const CorbaConsumer& x)
+#endif
: m_var(ObjectType::_duplicate(x.m_var))
{
}
@@ -391,7 +403,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ CorbaConsumer& operator=(CorbaConsumer& x)
+#else
CorbaConsumer& operator=(const CorbaConsumer& x)
+#endif
{
CorbaConsumer tmp(x);
tmp.swap(*this);
Modified: trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -91,7 +91,11 @@
bool
CorbaPort::registerProvider(const char* instance_name,
const char* type_name,
+#ifdef ORB_IS_ORBEXPRESS
+ PortableServer::ServantBase& provider)
+#else
PortableServer::RefCountServantBase& provider)
+#endif
{
RTC_TRACE(("registerProvider(instance=%s, type_name=%s)",
instance_name, type_name));
Modified: trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/CorbaPort.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -730,7 +730,11 @@
* @endif
*/
bool registerProvider(const char* instance_name, const char* type_name,
+#ifdef ORB_IS_ORBEXPRESS
+ PortableServer::ServantBase& provider);
+#else
PortableServer::RefCountServantBase& provider);
+#endif
/*!
* @if jp
@@ -1219,7 +1223,11 @@
public:
CorbaProviderHolder(const char* type_name,
const char* instance_name,
+#ifdef ORB_IS_ORBEXPRESS
+ PortableServer::ServantBase* servant)
+#else
PortableServer::RefCountServantBase* servant)
+#endif
: m_typeName(type_name),
m_instanceName(instance_name),
m_servant(servant),
@@ -1293,7 +1301,11 @@
private:
std::string m_typeName;
std::string m_instanceName;
+#ifdef ORB_IS_ORBEXPRESS
+ PortableServer::ServantBase* m_servant;
+#else
PortableServer::RefCountServantBase* m_servant;
+#endif
PortableServer::ObjectId_var m_oid;
std::string m_ior;
};
Modified: trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -719,7 +719,11 @@
* @brief Getting object reference
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ RTC::ExecutionContextService_ptr ExecutionContextBase::getObjRef(void)
+#else
RTC::ExecutionContextService_ptr ExecutionContextBase::getObjRef(void) const
+#endif
{
return m_profile.getObjRef();
}
@@ -768,7 +772,11 @@
* @brief Getting a reference of the owner component
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ const RTC::RTObject_ptr ExecutionContextBase::getOwner()
+#else
const RTC::RTObject_ptr ExecutionContextBase::getOwner() const
+#endif
{
return m_profile.getOwner();
}
Modified: trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextBase.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -863,7 +863,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ RTC::ExecutionContextService_ptr getObjRef(void);
+#else
RTC::ExecutionContextService_ptr getObjRef(void) const;
+#endif
/*!
* @if jp
@@ -944,7 +948,11 @@
* @return a reference of the owner RT-Component
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ const RTC::RTObject_ptr getOwner();
+#else
const RTC::RTObject_ptr getOwner() const;
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -92,7 +92,11 @@
* @endif
*/
RTC::ExecutionContextService_ptr
+#ifdef ORB_IS_ORBEXPRESS
+ ExecutionContextProfile::getObjRef(void)
+#else
ExecutionContextProfile::getObjRef(void) const
+#endif
{
RTC_TRACE(("getObjRef()"));
Guard guard(m_profileMutex);
@@ -240,7 +244,11 @@
* @brief Getting a reference of the owner component
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ const RTC::RTObject_ptr ExecutionContextProfile::getOwner()
+#else
const RTC::RTObject_ptr ExecutionContextProfile::getOwner() const
+#endif
{
RTC_TRACE(("getOwner()"));
Guard guard(m_profileMutex);
Modified: trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ExecutionContextProfile.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -137,7 +137,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ RTC::ExecutionContextService_ptr getObjRef(void);
+#else
RTC::ExecutionContextService_ptr getObjRef(void) const;
+#endif
/*!
* @if jp
@@ -303,7 +307,11 @@
* @return a reference of the owner RT-Component
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ const RTC::RTObject_ptr getOwner();
+#else
const RTC::RTObject_ptr getOwner() const;
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPort.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPort.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -440,7 +440,11 @@
{
Guard guard(m_valueMutex);
RTC_DEBUG(("data read succeeded"));
+#ifdef ORB_IS_ORBEXPRESS
+ cdr >> m_value;
+#else
m_value <<= cdr;
+#endif
if (m_OnReadConvert != 0)
{
m_value = (*m_OnReadConvert)(m_value);
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortConsumer.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -29,7 +29,7 @@
};
// Why RtORB does not allow forward declaration?
-#ifndef ORB_IS_RTORB
+#if not defined ORB_IS_RTORB && not defined ORB_IS_ORBEXPRESS
namespace SDOPackage
{
class NVList;
@@ -36,7 +36,12 @@
};
#endif // ORB_IS_RTORB
+#ifdef ORB_IS_ORBEXPRESS
+class CORBA::Stream;
+typedef CORBA::Stream cdrMemoryStream;
+#else
class cdrMemoryStream;
+#endif
namespace RTC
{
@@ -144,7 +149,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode put(CORBA::Stream& data) = 0;
+#else
virtual ReturnCode put(const cdrMemoryStream& data) = 0;
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -67,13 +67,24 @@
* @endif
*/
InPortConsumer::ReturnCode InPortCorbaCdrConsumer::
+#ifdef ORB_IS_ORBEXPRESS
+ put(CORBA::Stream& data)
+#else
put(const cdrMemoryStream& data)
+#endif
{
RTC_PARANOID(("put()"));
#ifndef ORB_IS_RTORB
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Octet* to;
+ *static_cast<CORBA::Octet*>(to) = data.read_octet();
+ ::OpenRTM::CdrData tmp(data.size_written(), data.size_written(),
+ to, 0);
+#else
::OpenRTM::CdrData tmp(data.bufSize(), data.bufSize(),
static_cast<CORBA::Octet*>(data.bufPtr()), 0);
+#endif
#else // ORB_IS_RTORB
OpenRTM_CdrData *cdrdata_tmp = new OpenRTM_CdrData();
cdrdata_tmp->_buffer =
@@ -216,7 +227,11 @@
}
CORBA::Object_var obj;
+#ifdef ORB_IS_ORBEXPRESS
+ if (!(properties[index].value >>= obj))
+#else
if (!(properties[index].value >>= CORBA::Any::to_object(obj.out())))
+#endif
{
RTC_ERROR(("prop[inport_ref] is not objref"));
return true;
@@ -292,7 +307,11 @@
if (index < 0) { return false; }
CORBA::Object_var obj;
+#ifdef ORB_IS_ORBEXPRESS
+ if (!(properties[index].value >>= obj))
+#else
if (!(properties[index].value >>= CORBA::Any::to_object(obj.out())))
+#endif
{
return false;
}
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrConsumer.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -155,7 +155,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode put(CORBA::Stream& data);
+#else
virtual ReturnCode put(const cdrMemoryStream& data);
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortCorbaCdrProvider.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -69,11 +69,19 @@
}
catch (PortableServer::POA::ServantNotActive &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (PortableServer::POA::WrongPolicy &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (...)
{
@@ -141,7 +149,12 @@
if (m_buffer == 0)
{
cdrMemoryStream cdr;
+#ifdef ORB_IS_ORBEXPRESS
+ cdr.write_array_1(data.get_buffer(), data.length());
+#else
cdr.put_octet_array(&(data[0]), data.length());
+#endif
+
onReceiverError(cdr);
return ::OpenRTM::PORT_ERROR;
}
@@ -151,10 +164,18 @@
// set endian type
bool endian_type = m_connector->isLittleEndian();
RTC_TRACE(("connector endian: %s", endian_type ? "little":"big"));
+
+#ifdef ORB_IS_ORBEXPRESS
+ cdr.is_little_endian(endian_type);
+ cdr.write_array_1(data.get_buffer(), data.length());
+ RTC_PARANOID(("converted CDR data size: %d", cdr.size_written()));
+#else
cdr.setByteSwapFlag(endian_type);
cdr.put_octet_array(&(data[0]), data.length());
+ RTC_PARANOID(("converted CDR data size: %d", cdr.bufSize()));
+#endif
- RTC_PARANOID(("converted CDR data size: %d", cdr.bufSize()));
+
onReceived(cdr);
BufferStatus::Enum ret = m_buffer->write(cdr);
Modified: trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -67,7 +67,11 @@
* @endif
*/
InPortConsumer::ReturnCode InPortDirectConsumer::
+#ifdef ORB_IS_ORBEXPRESS
+ put(CORBA::Stream& data)
+#else
put(const cdrMemoryStream& data)
+#endif
{
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-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/InPortDirectConsumer.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -154,7 +154,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode put(CORBA::Stream& data);
+#else
virtual ReturnCode put(const cdrMemoryStream& data);
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -501,8 +501,13 @@
if (comp == NULL)
{ RTC_ERROR(("%s not found.", comps[i].c_str())); continue; }
+#ifdef ORB_IS_ORBEXPRESS
+ ExecutionContextList* ecs = comp->get_owned_contexts();
+ (*ecs)[0]->activate_component(comp->getObjRef());
+#else
ExecutionContextList_var ecs = comp->get_owned_contexts();
ecs[0]->activate_component(comp->getObjRef());
+#endif
}
} // end of pre-activation
return true;
@@ -2051,8 +2056,13 @@
for (CORBA::ULong i(0), len(m_ecs.size()); i < len; ++i)
{
try{
+#ifdef ORB_IS_ORBEXPRESS
+ PortableServer::ServantBase* servant;
+ servant = dynamic_cast<PortableServer::ServantBase*>(m_ecs[i]);
+#else
PortableServer::RefCountServantBase* servant;
servant = dynamic_cast<PortableServer::RefCountServantBase*>(m_ecs[i]);
+#endif
if (servant == NULL)
{
RTC_ERROR(("Invalid dynamic cast. EC->RefCountServantBase failed."));
Modified: trunk/OpenRTM-aist/src/lib/rtm/ManagerConfig.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ManagerConfig.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ManagerConfig.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -235,6 +235,7 @@
//
// Get system information by using ACE_OS::uname (UNIX/Windows)
//
+#if not defined(VXWORKS) || defined(__RTP__)
coil::utsname sysinfo;
if (coil::uname(&sysinfo) != 0)
{
@@ -254,7 +255,7 @@
prop.setProperty("os.arch", sysinfo.machine);
prop.setProperty("os.hostname", sysinfo.nodename);
prop.setProperty("manager.pid", pidc);
-
+#endif
return;
}
Modified: trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -820,7 +820,11 @@
* @brief Get the reference of Manager.
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ RTM::Manager_ptr ManagerServant::getObjRef()
+#else
RTM::Manager_ptr ManagerServant::getObjRef() const
+#endif
{
return m_objref;
}
@@ -928,7 +932,11 @@
catch(CORBA::SystemException& e)
{
#ifndef ORB_IS_RTORB
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_DEBUG(("CORBA SystemException cought (CORBA::%s)", e._name()));
+#endif
#endif // ORB_IS_RTORB
}
catch (...)
Modified: trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -566,7 +566,11 @@
* @return Manager reference
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ RTM::Manager_ptr getObjRef();
+#else
RTM::Manager_ptr getObjRef() const;
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/ModuleManager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ModuleManager.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/ModuleManager.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -535,6 +535,7 @@
const coil::vstring& modules,
vProperties& modprops)
{
+#if not defined(VXWORKS_69) && not defined(VXWORKS_66)
std::string l = "manager.modules." + lang;
coil::Properties& lprop(Manager::instance().getConfig().getNode(l));
std::vector<coil::Properties> prop;
@@ -573,5 +574,7 @@
p["module_file_path"] = modules[i].c_str();
modprops.push_back(p);
}
+#endif
}
+
}; // namespace RTC
Modified: trunk/OpenRTM-aist/src/lib/rtm/NamingManager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NamingManager.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/NamingManager.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -69,7 +69,11 @@
* @endif
*/
void NamingOnCorba::bindObject(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ RTObject_impl* rtobj)
+#else
const RTObject_impl* rtobj)
+#endif
{
RTC_TRACE(("bindObject(name = %s, rtobj)", name));
#ifdef ORB_IS_OMNIORB
@@ -100,7 +104,11 @@
}
void NamingOnCorba::bindObject(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ PortBase* port)
+#else
const PortBase* port)
+#endif
{
RTC_TRACE(("bindObject(name = %s, rtobj)", name));
#ifdef ORB_IS_OMNIORB
@@ -131,7 +139,11 @@
}
void NamingOnCorba::bindObject(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ RTM::ManagerServant* mgr)
+#else
const RTM::ManagerServant* mgr)
+#endif
{
RTC_TRACE(("bindObject(name = %s, mgr)", name));
#ifdef ORB_IS_OMNIORB
@@ -234,7 +246,11 @@
* @endif
*/
void NamingManager::bindObject(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ RTObject_impl* rtobj)
+#else
const RTObject_impl* rtobj)
+#endif
{
RTC_TRACE(("NamingManager::bindObject(%s)", name));
@@ -257,7 +273,11 @@
registerCompName(name, rtobj);
}
void NamingManager::bindObject(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ PortBase* port)
+#else
const PortBase* port)
+#endif
{
RTC_TRACE(("NamingManager::bindObject(%s)", name));
@@ -280,7 +300,11 @@
registerPortName(name, port);
}
void NamingManager::bindObject(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ RTM::ManagerServant* mgr)
+#else
const RTM::ManagerServant* mgr)
+#endif
{
RTC_TRACE(("NamingManager::bindObject(%s)", name));
@@ -494,7 +518,11 @@
* @endif
*/
void NamingManager::registerCompName(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ RTObject_impl* rtobj)
+#else
const RTObject_impl* rtobj)
+#endif
{
for (int i(0), len(m_compNames.size()); i < len; ++i)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/NamingManager.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/NamingManager.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/NamingManager.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -109,8 +109,14 @@
*
* @endif
*/
+
+#ifdef ORB_IS_ORBEXPRESS
+ virtual void bindObject(const char* name, PortBase* port) = 0;
+ virtual void bindObject(const char* name, RTObject_impl* rtobj) = 0;
+#else
+ virtual void bindObject(const char* name, const PortBase* port) = 0;
virtual void bindObject(const char* name, const RTObject_impl* rtobj) = 0;
- virtual void bindObject(const char* name, const PortBase* port) = 0;
+#endif
/*!
* @if jp
@@ -130,8 +136,14 @@
*
* @endif
*/
+
+
virtual void bindObject(const char* name,
+#ifdef ORB_IS_ORBEXPRESS
+ RTM::ManagerServant* mgr) = 0;
+#else
const RTM::ManagerServant* mgr) = 0;
+#endif
/*!
* @if jp
@@ -286,8 +298,14 @@
*
* @endif
*/
+
+#ifdef ORB_IS_ORBEXPRESS
+ virtual void bindObject(const char* name, RTObject_impl* rtobj);
+ virtual void bindObject(const char* name, PortBase* port);
+#else
virtual void bindObject(const char* name, const RTObject_impl* rtobj);
virtual void bindObject(const char* name, const PortBase* port);
+#endif
/*!
* @if jp
@@ -306,7 +324,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual void bindObject(const char* name, RTM::ManagerServant* mgr);
+#else
virtual void bindObject(const char* name, const RTM::ManagerServant* mgr);
+#endif
/*!
* @if jp
@@ -464,8 +486,14 @@
*
* @endif
*/
+
+#ifdef ORB_IS_ORBEXPRESS
+ void bindObject(const char* name, PortBase* port);
+ void bindObject(const char* name, RTObject_impl* rtobj);
+#else
+ void bindObject(const char* name, const PortBase* port);
void bindObject(const char* name, const RTObject_impl* rtobj);
- void bindObject(const char* name, const PortBase* port);
+#endif
/*!
* @if jp
@@ -490,7 +518,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ void bindObject(const char* name, RTM::ManagerServant* mgr);
+#else
void bindObject(const char* name, const RTM::ManagerServant* mgr);
+#endif
/*!
* @if jp
@@ -640,7 +672,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ void registerCompName(const char* name, RTObject_impl* rtobj);
+#else
void registerCompName(const char* name, const RTObject_impl* rtobj);
+#endif
/*!
* @if jp
@@ -783,11 +819,19 @@
*/
struct Comps
{
+#ifdef ORB_IS_ORBEXPRESS
+ Comps(const char* n, RTObject_impl* obj)
+#else
Comps(const char* n, const RTObject_impl* obj)
+#endif
: name(n), rtobj(obj)
{}
std::string name;
+#ifdef ORB_IS_ORBEXPRESS
+ RTObject_impl* rtobj;
+#else
const RTObject_impl* rtobj;
+#endif
};
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortConnector.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -159,7 +159,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode write(CORBA::Stream& data) = 0;
+#else
virtual ReturnCode write(const cdrMemoryStream& data) = 0;
+#endif
/*!
* @if jp
@@ -248,10 +252,19 @@
return PORT_OK;
}
// normal case
+#ifdef ORB_IS_ORBEXPRESS
+ m_cdr.rewind();
+
+ RTC_TRACE(("connector endian: %s", isLittleEndian() ? "little":"big"));
+ m_cdr.is_little_endian(isLittleEndian());
+ m_cdr << data;
+#else
m_cdr.rewindPtrs();
+
RTC_TRACE(("connector endian: %s", isLittleEndian() ? "little":"big"));
m_cdr.setByteSwapFlag(isLittleEndian());
data >>= m_cdr;
+#endif
return write(m_cdr);
}
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortConsumer.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortConsumer.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortConsumer.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -25,7 +25,7 @@
#include <rtm/CdrBufferBase.h>
// Why RtORB does not allow the following foward declaration?
-#ifndef ORB_IS_RTORB
+#if not defined(ORB_IS_RTORB) && not defined(ORB_IS_ORBEXPRESS)
namespace SDOPackage
{
class NVList;
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrConsumer.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -106,7 +106,11 @@
if (ret == ::OpenRTM::PORT_OK)
{
RTC_DEBUG(("get() successful"));
+#ifdef ORB_IS_ORBEXPRESS
+ data.write_array_1(cdr_data->get_buffer(), (CORBA::ULong)cdr_data->length());
+#else
data.put_octet_array(&(cdr_data[0]), (int)cdr_data->length());
+#endif
RTC_PARANOID(("CDR data length: %d", cdr_data->length()));
onReceived(data);
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortCorbaCdrProvider.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -75,11 +75,20 @@
}
catch (PortableServer::POA::ServantNotActive &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
+
}
catch (PortableServer::POA::WrongPolicy &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (...)
{
@@ -163,7 +172,11 @@
if (ret == CdrBufferBase::BUFFER_OK)
{
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::ULong len((CORBA::ULong)cdr.size_written());
+#else
CORBA::ULong len((CORBA::ULong)cdr.bufSize());
+#endif
RTC_PARANOID(("converted CDR data size: %d", len));
if (len == (CORBA::ULong)0) {
@@ -172,7 +185,11 @@
}
#ifndef ORB_IS_RTORB
data->length(len);
+#ifdef ORB_IS_ORBEXPRESS
+ cdr.read_array_1(data->get_buffer(), len);
+#else
cdr.get_octet_array(&((*data)[0]), len);
+#endif
#else
data->length(len);
cdr.get_octet_array((char *)&((*data)[0]), (int)len);
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -76,7 +76,11 @@
* @endif
*/
ConnectorBase::ReturnCode
+#ifdef ORB_IS_ORBEXPRESS
+ OutPortPullConnector::write(CORBA::Stream& data)
+#else
OutPortPullConnector::write(const cdrMemoryStream& data)
+#endif
{
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-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPullConnector.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -162,7 +162,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode write(CORBA::Stream& data);
+#else
virtual ReturnCode write(const cdrMemoryStream& data);
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -83,10 +83,18 @@
* @endif
*/
ConnectorBase::ReturnCode
+#ifdef ORB_IS_ORBEXPRESS
+ OutPortPushConnector::write(CORBA::Stream& data)
+#else
OutPortPushConnector::write(const cdrMemoryStream& data)
+#endif
{
RTC_TRACE(("write()"));
+#ifdef ORB_IS_ORBEXPRESS
+ RTC_PARANOID(("data size = %d bytes", data.size_written()));
+#else
RTC_PARANOID(("data size = %d bytes", data.bufSize()));
+#endif
return m_publisher->write(data, 0, 0);
}
Modified: trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/OutPortPushConnector.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -189,7 +189,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode write(CORBA::Stream& data);
+#else
virtual ReturnCode write(const cdrMemoryStream& data);
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/PeriodicECSharedComposite.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PeriodicECSharedComposite.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PeriodicECSharedComposite.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -321,6 +321,18 @@
{
if (::CORBA::is_nil(m_ec))
{
+#ifdef ORB_IS_ORBEXPRESS
+ ::RTC::ExecutionContextList* ecs(m_rtobj->get_owned_contexts());
+ if (ecs->length() > 0)
+ {
+ m_ec = (*ecs)[0];
+ }
+ else
+ {
+ return;
+ }
+ }
+#else
::RTC::ExecutionContextList_var ecs(m_rtobj->get_owned_contexts());
if (ecs->length() > 0)
{
@@ -331,6 +343,8 @@
return;
}
}
+#endif
+
// set ec to target RTC
m_ec->add_component(member.rtobj_.in());
@@ -366,6 +380,15 @@
{
if (::CORBA::is_nil(m_ec))
{
+#ifdef ORB_IS_ORBEXPRESS
+ ::RTC::ExecutionContextList* ecs(m_rtobj->get_owned_contexts());
+ if (ecs->length() == 0)
+ {
+ RTC_FATAL(("no owned EC"));
+ return;
+ }
+ m_ec = (*ecs)[0];
+#else
::RTC::ExecutionContextList_var ecs(m_rtobj->get_owned_contexts());
if (ecs->length() == 0)
{
@@ -373,6 +396,7 @@
return;
}
m_ec = ecs[0];
+#endif
}
m_ec->remove_component(member.rtobj_.in());
@@ -696,13 +720,21 @@
ReturnCode_t PeriodicECSharedComposite::onActivated(RTC::UniqueId exec_handle)
{
RTC_TRACE(("onActivated(%d)", exec_handle));
+#ifdef ORB_IS_ORBEXPRESS
+ ::RTC::ExecutionContextList* ecs(get_owned_contexts());
+#else
::RTC::ExecutionContextList_var ecs(get_owned_contexts());
+#endif
::SDOPackage::SDOList_var sdos(m_org->get_members());
for (::CORBA::ULong i(0), len(sdos->length()); i < len; ++i)
{
::RTC::RTObject_var rtc(::RTC::RTObject::_narrow(sdos[i]));
+#ifdef ORB_IS_ORBEXPRESS
+ (*ecs)[0]->activate_component(rtc.in());
+#else
ecs[0]->activate_component(rtc.in());
+#endif
}
RTC_DEBUG(("%d member RTC%s activated.", sdos->length(),
sdos->length() == 1 ? " was" : "s were"));
@@ -719,13 +751,21 @@
ReturnCode_t PeriodicECSharedComposite::onDeactivated(RTC::UniqueId exec_handle)
{
RTC_TRACE(("onDeactivated(%d)", exec_handle));
+#ifdef ORB_IS_ORBEXPRESS
+ ::RTC::ExecutionContextList* ecs(get_owned_contexts());
+#else
::RTC::ExecutionContextList_var ecs(get_owned_contexts());
+#endif
::SDOPackage::SDOList_var sdos(m_org->get_members());
for (::CORBA::ULong i(0), len(sdos->length()); i < len; ++i)
{
::RTC::RTObject_var rtc(::RTC::RTObject::_narrow(sdos[i]));
+#ifdef ORB_IS_ORBEXPRESS
+ (*ecs)[0]->deactivate_component(rtc.in());
+#else
ecs[0]->deactivate_component(rtc.in());
+#endif
}
return ::RTC::RTC_OK;
}
@@ -740,13 +780,21 @@
ReturnCode_t PeriodicECSharedComposite::onReset(RTC::UniqueId exec_handle)
{
RTC_TRACE(("onReset(%d)", exec_handle));
+#ifdef ORB_IS_ORBEXPRESS
+ ::RTC::ExecutionContextList* ecs(get_owned_contexts());
+#else
::RTC::ExecutionContextList_var ecs(get_owned_contexts());
+#endif
::SDOPackage::SDOList_var sdos(m_org->get_members());
for (::CORBA::ULong i(0), len(sdos->length()); i < len; ++i)
{
::RTC::RTObject_var rtc(::RTC::RTObject::_narrow(sdos[i]));
+#ifdef ORB_IS_ORBEXPRESS
+ (*ecs)[0]->reset_component(rtc.in());
+#else
ecs[0]->reset_component(rtc.in());
+#endif
}
return ::RTC::RTC_OK;
}
Modified: trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -119,7 +119,11 @@
* @brief Get PortProfileList
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PortProfileList PortAdmin::getPortProfileList()
+#else
PortProfileList PortAdmin::getPortProfileList() const
+#endif
{
#ifndef ORB_IS_RTORB
@@ -158,7 +162,11 @@
* @brief Get the reference to the Port's object
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PortService_ptr PortAdmin::getPortRef(const char* port_name)
+#else
PortService_ptr PortAdmin::getPortRef(const char* port_name) const
+#endif
{
CORBA::Long index;
index = CORBA_SeqUtil::find(m_portRefs, find_port_name(port_name));
Modified: trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PortAdmin.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -130,7 +130,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PortProfileList getPortProfileList();
+#else
PortProfileList getPortProfileList() const;
+#endif
/*!
* @if jp
@@ -158,7 +162,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PortService_ptr getPortRef(const char* port_name);
+#else
PortService_ptr getPortRef(const char* port_name) const;
+#endif
/*!
* @if jp
@@ -561,7 +569,11 @@
{
public:
port_prof_collect(PortProfileList& p) : m_p(p) {}
+#ifdef ORB_IS_ORBEXPRESS
+ void operator()(PortBase* port)
+#else
void operator()(const PortBase* port)
+#endif
{
CORBA_SeqUtil::push_back(m_p, port->getPortProfile());
}
@@ -580,7 +592,11 @@
{
public:
port_prof_collect2(PortProfileList& p) : m_p(p) {}
+#ifdef ORB_IS_ORBEXPRESS
+ void operator()(PortService_ptr port)
+#else
void operator()(const PortService_ptr port)
+#endif
{
PortProfile* pp(port->get_port_profile());
CORBA_SeqUtil::push_back(m_p, *(pp));
Modified: trunk/OpenRTM-aist/src/lib/rtm/PortBase.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PortBase.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PortBase.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -78,11 +78,19 @@
}
catch (PortableServer::POA::ServantNotActive &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (PortableServer::POA::WrongPolicy &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (...)
{
@@ -370,7 +378,11 @@
catch (CORBA::SystemException &e)
{
#ifndef ORB_IS_RTORB
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_WARN(("Exception caught: minor code(%d).", e.minor()));;
+#endif
#else // ORB_IS_RTORB
RTC_WARN(("Exception caught"));
#endif // ORB_IS_RTORB
@@ -542,7 +554,11 @@
* @brief Get the object reference of the Port
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PortService_ptr PortBase::getPortRef()
+#else
PortService_ptr PortBase::getPortRef() const
+#endif
{
RTC_TRACE(("getPortRef()"));
Guard gurad(m_profile_mutex);
@@ -675,7 +691,11 @@
catch (CORBA::SystemException& e)
{
#ifndef ORB_IS_RTORB
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_WARN(("Exception caught: minor code.", e.minor()));
+#endif
#else // ORB_IS_RTORB
RTC_WARN(("Exception caught"));
#endif // ORB_IS_RTORB
Modified: trunk/OpenRTM-aist/src/lib/rtm/PortBase.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PortBase.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PortBase.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -961,7 +961,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PortService_ptr getPortRef();
+#else
PortService_ptr getPortRef() const;
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherBase.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherBase.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherBase.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -253,7 +253,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode write(CORBA::Stream& data,
+#else
virtual ReturnCode write(const cdrMemoryStream& data,
+#endif
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-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -133,7 +133,11 @@
* @brief Write data
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PublisherBase::ReturnCode PublisherFlush::write(CORBA::Stream& data,
+#else
PublisherBase::ReturnCode PublisherFlush::write(const cdrMemoryStream& data,
+#endif
unsigned long sec,
unsigned long usec)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherFlush.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -265,7 +265,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode write(CORBA::Stream& data,
+#else
virtual ReturnCode write(const cdrMemoryStream& data,
+#endif
unsigned long sec,
unsigned long usec);
/*!
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -42,7 +42,7 @@
PublisherNew::PublisherNew()
: rtclog("PublisherNew"),
m_consumer(0), m_buffer(0), m_task(0), m_listeners(0),
- m_retcode(PORT_OK), m_pushPolicy(NEW),
+ m_retcode(PORT_OK), m_pushPolicy(PUBLISHER_POLICY_NEW),
m_skipn(0), m_active(false), m_leftskip(0)
{
}
@@ -162,7 +162,11 @@
* @brief Write data
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ PublisherBase::ReturnCode PublisherNew::write(CORBA::Stream& data,
+#else
PublisherBase::ReturnCode PublisherNew::write(const cdrMemoryStream& data,
+#endif
unsigned long sec,
unsigned long usec)
{
@@ -248,16 +252,16 @@
Guard guard(m_retmutex);
switch (m_pushPolicy)
{
- case ALL:
+ case PUBLISHER_POLICY_ALL:
m_retcode = pushAll();
break;
- case FIFO:
+ case PUBLISHER_POLICY_FIFO:
m_retcode = pushFifo();
break;
- case SKIP:
+ case PUBLISHER_POLICY_SKIP:
m_retcode = pushSkip();
break;
- case NEW:
+ case PUBLISHER_POLICY_NEW:
m_retcode = pushNew();
break;
default:
@@ -281,14 +285,14 @@
RTC_DEBUG(("push_policy: %s", push_policy.c_str()));
coil::normalize(push_policy);
- if (push_policy == "all") { m_pushPolicy = ALL; }
- else if (push_policy == "fifo") { m_pushPolicy = FIFO; }
- else if (push_policy == "skip") { m_pushPolicy = SKIP; }
- else if (push_policy == "new") { m_pushPolicy = NEW; }
+ if (push_policy == "all") { m_pushPolicy = PUBLISHER_POLICY_ALL; }
+ else if (push_policy == "fifo") { m_pushPolicy = PUBLISHER_POLICY_FIFO; }
+ else if (push_policy == "skip") { m_pushPolicy = PUBLISHER_POLICY_SKIP; }
+ else if (push_policy == "new") { m_pushPolicy = PUBLISHER_POLICY_NEW; }
else
{
RTC_ERROR(("invalid push_policy value: %s", push_policy.c_str()));
- m_pushPolicy = NEW; // default push policy
+ m_pushPolicy = PUBLISHER_POLICY_NEW; // default push policy
}
// skip_count default: 0
@@ -392,6 +396,7 @@
RTC_TRACE(("pushFifo()"));
cdrMemoryStream& cdr(m_buffer->get());
+
onBufferRead(cdr);
onSend(cdr);
@@ -423,7 +428,11 @@
{
m_buffer->advanceRptr(postskip);
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Stream& cdr(m_buffer->get());
+#else
const cdrMemoryStream& cdr(m_buffer->get());
+#endif
onBufferRead(cdr);
onSend(cdr);
@@ -465,7 +474,11 @@
m_buffer->advanceRptr(m_buffer->readable() - 1);
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Stream& cdr(m_buffer->get());
+#else
cdrMemoryStream& cdr(m_buffer->get());
+#endif
onBufferRead(cdr);
onSend(cdr);
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherNew.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -323,7 +323,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode write(CORBA::Stream& data,
+#else
virtual ReturnCode write(const cdrMemoryStream& data,
+#endif
unsigned long sec,
unsigned long usec);
@@ -428,12 +432,13 @@
protected:
enum Policy
{
- ALL,
- FIFO,
- SKIP,
- NEW
+ PUBLISHER_POLICY_ALL,
+ PUBLISHER_POLICY_FIFO,
+ PUBLISHER_POLICY_SKIP,
+ PUBLISHER_POLICY_NEW
};
+
/*!
* @if jp
* @brief PushPolicy ¤ÎÀßÄê
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -40,7 +40,7 @@
PublisherPeriodic::PublisherPeriodic()
: rtclog("PublisherPeriodic"),
m_consumer(0), m_buffer(0), m_task(0), m_listeners(0),
- m_retcode(PORT_OK), m_pushPolicy(NEW),
+ m_retcode(PORT_OK), m_pushPolicy(PUBLISHER_POLICY_NEW),
m_skipn(0), m_active(false), m_readback(false), m_leftskip(0)
{
}
@@ -170,7 +170,11 @@
* @endif
*/
PublisherBase::ReturnCode
+#ifdef ORB_IS_ORBEXPRESS
+ PublisherPeriodic::write(CORBA::Stream& data,
+#else
PublisherPeriodic::write(const cdrMemoryStream& data,
+#endif
unsigned long sec,
unsigned long usec)
{
@@ -255,16 +259,16 @@
Guard guard(m_retmutex);
switch (m_pushPolicy)
{
- case ALL:
+ case PUBLISHER_POLICY_ALL:
m_retcode = pushAll();
break;
- case FIFO:
+ case PUBLISHER_POLICY_FIFO:
m_retcode = pushFifo();
break;
- case SKIP:
+ case PUBLISHER_POLICY_SKIP:
m_retcode = pushSkip();
break;
- case NEW:
+ case PUBLISHER_POLICY_NEW:
m_retcode = pushNew();
break;
default:
@@ -284,7 +288,11 @@
while (m_buffer->readable() > 0)
{
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Stream& cdr(m_buffer->get());
+#else
const cdrMemoryStream& cdr(m_buffer->get());
+#endif
onBufferRead(cdr);
onSend(cdr);
@@ -310,7 +318,11 @@
RTC_TRACE(("pushFifo()"));
if (bufferIsEmpty()) { return BUFFER_EMPTY; }
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Stream& cdr(m_buffer->get());
+#else
const cdrMemoryStream& cdr(m_buffer->get());
+#endif
onBufferRead(cdr);
onSend(cdr);
@@ -345,8 +357,11 @@
{
m_buffer->advanceRptr(postskip);
readable -= postskip;
-
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Stream& cdr(m_buffer->get());
+#else
const cdrMemoryStream& cdr(m_buffer->get());
+#endif
onBufferRead(cdr);
onSend(cdr);
@@ -381,7 +396,11 @@
m_readback = true;
m_buffer->advanceRptr(m_buffer->readable() - 1);
+#ifdef ORB_IS_ORBEXPRESS
+ CORBA::Stream& cdr(m_buffer->get());
+#else
const cdrMemoryStream& cdr(m_buffer->get());
+#endif
onBufferRead(cdr);
onSend(cdr);
@@ -412,14 +431,14 @@
RTC_DEBUG(("push_policy: %s", push_policy.c_str()));
coil::normalize(push_policy);
- if (push_policy == "all") { m_pushPolicy = ALL; }
- else if (push_policy == "fifo") { m_pushPolicy = FIFO; }
- else if (push_policy == "skip") { m_pushPolicy = SKIP; }
- else if (push_policy == "new") { m_pushPolicy = NEW; }
+ if (push_policy == "all") { m_pushPolicy = PUBLISHER_POLICY_ALL; }
+ else if (push_policy == "fifo") { m_pushPolicy = PUBLISHER_POLICY_FIFO; }
+ else if (push_policy == "skip") { m_pushPolicy = PUBLISHER_POLICY_SKIP; }
+ else if (push_policy == "new") { m_pushPolicy = PUBLISHER_POLICY_NEW; }
else
{
RTC_ERROR(("invalid push_policy value: %s", push_policy.c_str()));
- m_pushPolicy = NEW; // default push policy
+ m_pushPolicy = PUBLISHER_POLICY_NEW; // default push policy
}
// skip_count default: 0
Modified: trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/PublisherPeriodic.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -323,7 +323,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ virtual ReturnCode write(CORBA::Stream& data,
+#else
virtual ReturnCode write(const cdrMemoryStream& data,
+#endif
unsigned long sec,
unsigned long usec);
/*!
@@ -427,10 +431,10 @@
protected:
enum Policy
{
- ALL,
- FIFO,
- SKIP,
- NEW
+ PUBLISHER_POLICY_ALL,
+ PUBLISHER_POLICY_FIFO,
+ PUBLISHER_POLICY_SKIP,
+ PUBLISHER_POLICY_NEW
};
/*!
Modified: trunk/OpenRTM-aist/src/lib/rtm/RTC.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTC.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTC.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -74,7 +74,11 @@
# define WINAPI
#endif /* Windows */
+#ifdef ORB_IS_ORBEXPRESS
+#include <CosNaming.h>
+#endif
+
//#if defined(COMPAT_OPENRTM_0_4)
#include <coil/Properties.h>
@@ -81,6 +85,9 @@
namespace RTC
{
typedef coil::Properties Properties;
+#ifdef ORB_IS_ORBEXPRESS
+ typedef CORBA::Stream cdrMemoryStream;
+#endif
};
//#endif // COMPAT_OPENRTM_0_4
Modified: trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -1505,7 +1505,11 @@
* @brief [local interface] Get the object reference
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ RTObject_ptr RTObject_impl::getObjRef()
+#else
RTObject_ptr RTObject_impl::getObjRef() const
+#endif
{
RTC_TRACE(("getObjRef()"));
@@ -2138,9 +2142,15 @@
m_eclist[i]->getObjRef()->stop();
try
{
+#ifdef ORB_IS_ORBEXPRESS
+ PortableServer::ServantBase* servant(NULL);
+ servant =
+ dynamic_cast<PortableServer::ServantBase*>(m_eclist[i]);
+#else
PortableServer::RefCountServantBase* servant(NULL);
servant =
dynamic_cast<PortableServer::RefCountServantBase*>(m_eclist[i]);
+#endif
if (servant == NULL)
{
RTC_ERROR(("Dynamic cast error: ECBase -> Servant."));
@@ -2154,11 +2164,19 @@
}
catch (PortableServer::POA::ServantNotActive &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (PortableServer::POA::WrongPolicy &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (...)
{
@@ -2495,11 +2513,19 @@
}
catch (PortableServer::POA::ServantNotActive &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (PortableServer::POA::WrongPolicy &e)
{
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("%s", e._name()));
+#endif
}
catch (...)
{
Modified: trunk/OpenRTM-aist/src/lib/rtm/RTObject.h
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTObject.h 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTObject.h 2017-05-30 09:47:01 UTC (rev 2994)
@@ -2163,7 +2163,11 @@
*
* @endif
*/
+#ifdef ORB_IS_ORBEXPRESS
+ RTObject_ptr getObjRef();
+#else
RTObject_ptr getObjRef() const;
+#endif
/*!
* @if jp
Modified: trunk/OpenRTM-aist/src/lib/rtm/SdoConfiguration.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/SdoConfiguration.cpp 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/src/lib/rtm/SdoConfiguration.cpp 2017-05-30 09:47:01 UTC (rev 2994)
@@ -409,7 +409,11 @@
catch (CORBA::SystemException& e)
{
#ifndef ORB_IS_RTORB
+#ifdef ORB_IS_ORBEXPRESS
+ oe_out << e << oe_endl << oe_flush;
+#else
RTC_ERROR(("CORBA::SystemException cought: %s", e._name()));
+#endif
#else
RTC_ERROR(("CORBA::SystemException cought."));
#endif
Added: trunk/OpenRTM-aist/src/lib/rtm/idl/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/idl/CMakeLists.txt (rev 0)
+++ trunk/OpenRTM-aist/src/lib/rtm/idl/CMakeLists.txt 2017-05-30 09:47:01 UTC (rev 2994)
@@ -0,0 +1,74 @@
+cmake_minimum_required (VERSION 2.6)
+
+
+
+
+
+
+
+
+set(IDL_COMPILE_COMMAND ${ORB_ROOT}/host/x86_linux_2.6/bin/idl2cpp)
+
+
+macro(idl_compile idl_name)
+
+ if(UNIX)
+ set(skelwrapper_commend ${OPENRTM_DIRS}/utils/rtm-skelwrapper/rtm-skelwrapper)
+ elseif(VXWORKS)
+ set(skelwrapper_commend ${OPENRTM_DIRS}/utils/rtm-skelwrapper/rtm-skelwrapper)
+ elseif(MSVC)
+ set(skelwrapper_commend ${OPENRTM_DIRS}/utils/rtm-skelwrapper/rtm-skelwrapper.py)
+ endif()
+ add_custom_command(
+ OUTPUT ${idl_name}Skel.cpp
+ #COMMAND mkdir -p include/rtm/idl
+ #COMMAND cd include/rtm/idl
+ COMMAND ${IDL_COMPILE_COMMAND} -m -a -ex -fhh -fxcc -fc_c -fs -q -dOE_IDL -I${PROJECT_SOURCE_DIR}/idl -I${ORB_ROOT}/idl ${PROJECT_SOURCE_DIR}/idl/${idl_name}.idl
+ COMMAND python ${skelwrapper_commend} --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=${idl_name}.idl
+ #WORKING_DIRECTORY ${CURRENT_BINARY_DIR}/include/rtm/idl
+ WORKING_DIRECTORY ${CURRENT_BINARY_DIR}
+ )
+
+
+ add_custom_target(${idl_name}_TGT DEPENDS ${idl_name}Skel.cpp)
+ set(ALL_IDL_SRCS ${ALL_IDL_SRCS} idl/${idl_name}Skel.cpp)
+
+ if(NOT TARGET ALL_IDL_TGT)
+ add_custom_target(ALL_IDL_TGT)
+ endif(NOT TARGET ALL_IDL_TGT)
+ add_dependencies(ALL_IDL_TGT ${idl_name}_TGT)
+ #include_directories(${PROJECT_BINARY_DIR}/idl)
+endmacro()
+
+
+
+set(idls
+ BasicDataType
+ DataPort
+ ExtendedDataTypes
+ InterfaceDataTypes
+ Manager
+ OpenRTM
+ RTC
+ SDOPackage
+ )
+
+
+foreach(idl ${idls})
+ idl_compile(${idl})
+endforeach(idl)
+
+
+
+
+
+
+
+
+
+set(ALL_IDL_SRCS ${ALL_IDL_SRCS} PARENT_SCOPE)
+
+
+
+
+
Modified: trunk/OpenRTM-aist/utils/rtm-skelwrapper/skel_wrapper.py
===================================================================
--- trunk/OpenRTM-aist/utils/rtm-skelwrapper/skel_wrapper.py 2017-05-25 05:56:43 UTC (rev 2993)
+++ trunk/OpenRTM-aist/utils/rtm-skelwrapper/skel_wrapper.py 2017-05-30 09:47:01 UTC (rev 2994)
@@ -61,6 +61,8 @@
# include "[include_dir]/[basename]-cpp-skels.h"
#elif defined ORB_IS_RTORB
# include "[include_dir][basename].h"
+#elif defined ORB_IS_ORBEXPRESS
+# include "[include_dir][basename].h"
#else
# error "NO ORB defined"
#endif
@@ -106,6 +108,8 @@
# include "[include_dir][basename]-stubs.c"
# include "[include_dir][basename]-skels.c"
# include "[include_dir][basename]-skelimpl.c"
+#elif defined ORB_IS_ORBEXPRESS
+# include "[include_dir][basename].cc"
#else
# error "NO ORB defined"
#endif
@@ -151,6 +155,8 @@
# include "[include_dir][basename]-cpp-stubs.h"
#elif defined ORB_IS_RTORB
# include "[include_dir][basename].h"
+#elif defined ORB_IS_ORBEXPRESS
+# include "[include_dir][basename]_c.h"
#else
# error "NO ORB defined"
#endif
@@ -190,6 +196,8 @@
[include_openrtm_idl_decls]
# include "[include_dir][basename]-common.c"
# include "[include_dir][basename]-stubs.c"
+#elif defined ORB_IS_ORBEXPRESS
+# include "[include_dir][basename]_c.cc"
#else
# error "NO ORB defined"
#endif
More information about the openrtm-commit
mailing list