├── tests ├── OpenRTI │ ├── CMakeLists.txt │ ├── threads │ │ └── CMakeLists.txt │ └── network │ │ └── CMakeLists.txt ├── RTI13 │ ├── link │ │ ├── CMakeLists.txt │ │ └── link.cpp │ ├── time │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ └── fddget │ │ ├── fdd-2.fed │ │ └── fdd-1.fed ├── rti1516 │ ├── link │ │ ├── CMakeLists.txt │ │ └── link.cpp │ ├── connect │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ ├── fddget │ │ ├── fdd-2.xml │ │ └── fdd-1.xml │ ├── sync │ │ └── CMakeLists.txt │ ├── interaction │ │ └── CMakeLists.txt │ ├── join │ │ └── CMakeLists.txt │ └── create │ │ └── CMakeLists.txt ├── rti1516e │ ├── link │ │ ├── CMakeLists.txt │ │ └── link.cpp │ ├── encode │ │ └── CMakeLists.txt │ ├── modules │ │ ├── UpdateRate1-1.xml │ │ ├── UpdateRate1-2.xml │ │ ├── UpdateRate2-1.xml │ │ ├── UpdateRate2-2.xml │ │ ├── Dimension1-1.xml │ │ ├── Dimension1-2.xml │ │ ├── Dimension2-1.xml │ │ ├── Dimension2-2.xml │ │ ├── ObjectClass1.xml │ │ ├── ObjectClass3.xml │ │ ├── InteractionClass1.xml │ │ ├── InteractionClass3.xml │ │ ├── ObjectClass1-1.xml │ │ ├── ObjectClass3-1.xml │ │ ├── ObjectClass1-2.xml │ │ ├── ObjectClass3-2.xml │ │ ├── ObjectClass2.xml │ │ ├── InteractionClass1-1.xml │ │ ├── InteractionClass3-1.xml │ │ ├── InteractionClass1-2.xml │ │ ├── InteractionClass3-2.xml │ │ ├── InteractionClass2.xml │ │ ├── ObjectClass2-1.xml │ │ ├── ObjectClass2-2.xml │ │ ├── InteractionClass2-1.xml │ │ ├── InteractionClass2-2.xml │ │ └── CMakeLists.txt │ ├── time │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ └── fddget │ │ ├── fdd-2.xml │ │ └── fdd-1.xml └── CMakeLists.txt ├── .gitignore ├── package ├── src │ └── pack-release └── RELEASE-CHECKLIST ├── LICENSE ├── src ├── CMakeLists.txt ├── rtinode │ ├── CMakeLists.txt │ └── rtinode-config.xml ├── OpenRTI │ ├── xml │ │ ├── winconfig.h │ │ ├── amigaconfig.h │ │ ├── xmltok_impl.h │ │ ├── COPYING-expat │ │ ├── macconfig.h │ │ ├── asciitab.h │ │ └── utf8tab.h │ ├── Attributes.cpp │ ├── win32 │ │ ├── SocketUDPWin32.cpp │ │ ├── ErrnoWin32.h │ │ ├── SocketDataWin32.cpp │ │ ├── MutexWin32.cpp │ │ ├── ErrnoWin32.cpp │ │ ├── SocketPipeWin32.cpp │ │ ├── SocketWin32.cpp │ │ ├── SocketPacketWin32.cpp │ │ ├── AtomicWin32.cpp │ │ ├── SocketServerWin32.cpp │ │ ├── MutexPrivateDataWin32.h │ │ └── SocketServerPipeWin32.cpp │ ├── AbstractServerNode.cpp │ ├── AbstractMessageSender.cpp │ ├── AbstractProtocolLayer.cpp │ ├── AbstractProtocolSocket.cpp │ ├── posix │ │ ├── SocketUDPPosix.cpp │ │ ├── SocketDataPosix.cpp │ │ ├── ErrnoPosix.h │ │ ├── MutexPosix.cpp │ │ ├── ThreadPosix.cpp │ │ ├── DynamicModulePosix.cpp │ │ └── ConditionPosix.cpp │ ├── FEDFileReader.h │ ├── AbstractMessage.cpp │ ├── AbstractLogicalTime.h │ ├── FDD1516FileReader.h │ ├── FDD1516EFileReader.h │ ├── InternalTimeManagement.cpp │ ├── ErrorHandler.cpp │ ├── ExpatXMLReader.h │ ├── AbstractProtocol.h │ ├── ScopeUnlock.h │ ├── SocketServer.h │ ├── Rand.h │ ├── SocketPipe.h │ ├── ErrorHandler.h │ ├── SocketServerTCP.h │ ├── SocketServerPipe.h │ ├── AbstractMessageSender.h │ ├── SocketTCP.h │ ├── SocketData.h │ ├── SocketPacket.h │ ├── AbstractMessageReceiver.h │ ├── Thread.h │ ├── AbstractSocketEvent.cpp │ ├── InitialServerStreamProtocol.h │ ├── DefaultErrorHandler.h │ ├── DynamicModule.h │ ├── XMLReader.cpp │ ├── ThreadServer.h │ ├── DefaultErrorHandler.cpp │ ├── Socket.h │ ├── ZLibProtocolLayer.h │ ├── XMLReader.h │ ├── ScopeLock.h │ ├── ContentHandler.cpp │ ├── SocketServerAcceptEvent.h │ ├── SocketUDP.h │ ├── NestedProtocolLayer.cpp │ ├── TightBE1MessageEncoding.h │ ├── Options.h │ ├── InitialClientStreamProtocol.h │ ├── ThreadLocal.h │ ├── Mutex.h │ └── AbstractMessageEncoding.cpp ├── rti1516e │ ├── NullFederateAmbassador.cpp │ ├── LogicalTimeFactory.cpp │ ├── FederateAmbassador.cpp │ ├── Encoding.h │ ├── EncodingExceptions.cpp │ ├── RTIambassador.cpp │ ├── LogicalTime.cpp │ ├── LogicalTimeFactoryFactory.cpp │ ├── Version.cpp │ ├── LogicalTimeInterval.cpp │ ├── RTIambassadorFactory.cpp │ ├── VariableLengthDataFriend.h │ ├── DataElement.cpp │ └── HLAlogicalTimeFactoryFactory.cpp ├── rti1516 │ ├── NullFederateAmbassador.cpp │ ├── LogicalTimeFactory.cpp │ ├── RTIambassador.cpp │ ├── FederateAmbassador.cpp │ ├── LogicalTime.cpp │ ├── Version.cpp │ ├── LogicalTimeInterval.cpp │ ├── VariableLengthDataFriend.h │ ├── RTIambassadorFactory.cpp │ ├── HLAfloat64TimeFactory.cpp │ └── HLAinteger64TimeFactory.cpp └── RTI13 │ ├── FederateHandleSetImplementation.h │ ├── AttributeHandleSetImplementation.h │ └── AttributeHandleSetCallback.h ├── python ├── rti1516 │ └── CMakeLists.txt └── rti1516e │ └── CMakeLists.txt ├── include ├── RTI13 │ └── baseTypes.hh ├── rti1516 │ └── RTI │ │ ├── RTIambassadorFactory.h │ │ ├── RangeBounds.h │ │ ├── HLAfloat64TimeFactory.h │ │ ├── HLAinteger64TimeFactory.h │ │ └── RTI1516.h └── rti1516e │ └── RTI │ ├── encoding │ └── EncodingExceptions.h │ ├── RTIambassadorFactory.h │ └── RangeBounds.h └── cmake ├── CreateResource.cmake └── PkgConfig.cmake /tests/OpenRTI/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Just for propper recursion 2 | add_subdirectory(network) 3 | add_subdirectory(threads) 4 | -------------------------------------------------------------------------------- /tests/RTI13/link/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test if dynamic linking works as required by the standard 2 | add_executable(link-13 link.cpp) 3 | target_link_libraries(link-13 RTI-NG FedTime) 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | GNUmakefile 2 | Makefile 3 | CMakeCache.txt 4 | CMakeFiles 5 | cmake_install.cmake 6 | CTestTestfile.cmake 7 | install_manifest.txt 8 | Testing 9 | .gdb_history 10 | *~ 11 | -------------------------------------------------------------------------------- /tests/rti1516/link/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test if dynamic linking works as required by the standard 2 | add_executable(link-1516 link.cpp) 3 | target_link_libraries(link-1516 rti1516 fedtime1516) 4 | -------------------------------------------------------------------------------- /tests/rti1516e/link/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test if dynamic linking works as required by the standard 2 | add_executable(link-1516e link.cpp) 3 | target_link_libraries(link-1516e rti1516e fedtime1516e) 4 | -------------------------------------------------------------------------------- /tests/rti1516e/encode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(encode-1516e encode.cpp) 2 | target_link_libraries(encode-1516e rti1516e fedtime1516e) 3 | 4 | add_test(rti1516e/encode-1516e "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/encode-1516e") 5 | -------------------------------------------------------------------------------- /package/src/pack-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | pktag="${1}" 4 | if [ "x${pktag}" == "x" ] ; then 5 | echo "No tag to pack given. Aborting!" 6 | exit 1 7 | fi 8 | 9 | git archive --prefix="${pktag}/" "${pktag}" | bzip2 > /tmp/"${pktag}.tar.bz2" 10 | echo "Written package to \"/tmp/${pktag}.tar.bz2\"" 11 | -------------------------------------------------------------------------------- /tests/OpenRTI/threads/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_BINARY_DIR}/src/OpenRTI) 2 | include_directories(${CMAKE_SOURCE_DIR}/src/OpenRTI) 3 | 4 | add_executable(threads threads.cpp) 5 | target_link_libraries(threads OpenRTI) 6 | 7 | add_test(OpenRTI/threads-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/threads") 8 | 9 | -------------------------------------------------------------------------------- /tests/RTI13/time/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(logical-time-13 logical-time.cpp) 2 | target_link_libraries(logical-time-13 FedTime OpenRTI) 3 | 4 | # Test the different logical times by getting the values form the logical time factory 5 | add_test(rti13/logical-time-13-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/logical-time-13") 6 | -------------------------------------------------------------------------------- /tests/rti1516/connect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Query something from an fdd 2 | add_executable(connect-1516 connect.cpp) 3 | target_link_libraries(connect-1516 rti1516 fedtime1516 OpenRTI) 4 | 5 | # Run tests with failing connects 6 | add_test(rti1516/connect-1516-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/connect-1516" -O "${RTI1516_FDD_FILE}") 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | LICENSE 2 | 3 | You may use, distribute and copy OpenRTI under the terms of 4 | either the GNU Lesser General Public License version 2.1, 3.0 5 | or the Mozilla Public License Version 2.0. Choose one of these 6 | that fits your requirements. The complete license texts can be 7 | found in the files lgpl-2.1.txt, lgpl-3.txt or mpl-2.0.txt 8 | accordingly. 9 | 10 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Just for propper recursion 2 | add_subdirectory(OpenRTI) 3 | if(OPENRTI_ENABLE_RTI13) 4 | if(NOT WIN32 OR OPENRTI_BUILD_SHARED) 5 | add_subdirectory(RTI13) 6 | endif() 7 | endif() 8 | if(OPENRTI_ENABLE_RTI1516) 9 | add_subdirectory(rti1516) 10 | endif() 11 | if(OPENRTI_ENABLE_RTI1516E) 12 | add_subdirectory(rti1516e) 13 | endif() 14 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Just for propper recursion 2 | add_subdirectory(OpenRTI) 3 | add_subdirectory(rtinode) 4 | 5 | if(OPENRTI_ENABLE_RTI13) 6 | if(NOT WIN32 OR OPENRTI_BUILD_SHARED) 7 | add_subdirectory(RTI13) 8 | endif() 9 | endif() 10 | if(OPENRTI_ENABLE_RTI1516) 11 | add_subdirectory(rti1516) 12 | endif() 13 | if(OPENRTI_ENABLE_RTI1516E) 14 | add_subdirectory(rti1516e) 15 | endif() 16 | -------------------------------------------------------------------------------- /package/RELEASE-CHECKLIST: -------------------------------------------------------------------------------- 1 | * Builds everywhere? 2 | * Tests have passed? 3 | (can use script in package/src/compile-test) 4 | 5 | * Make sure the protocol version is non beta 6 | * Create a release branch 7 | * Complete the CHANGES file 8 | * Update the packaging version numbers 9 | Top level cmake file 10 | rpm spec file 11 | * Add a release tag 12 | 13 | * Update the CHANGES file in master 14 | 15 | -------------------------------------------------------------------------------- /tests/OpenRTI/network/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_BINARY_DIR}/src/OpenRTI) 2 | include_directories(${CMAKE_SOURCE_DIR}/src/OpenRTI) 3 | 4 | add_executable(socketaddress socketaddress.cpp) 5 | target_link_libraries(socketaddress OpenRTI) 6 | 7 | add_test(OpenRTI/socketaddress "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/socketaddress") 8 | 9 | add_executable(url url.cpp) 10 | target_link_libraries(url OpenRTI) 11 | 12 | add_test(OpenRTI/url "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/url") 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/UpdateRate1-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | UpdateRate1 9 | 1 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/UpdateRate1-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | UpdateRate1 9 | 2 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/UpdateRate2-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | UpdateRate2 9 | 2 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/UpdateRate2-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | UpdateRate2 9 | 3 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/RTI13/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The current standard fdd used for testing 2 | #set(RTI13_FED_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fed.fed) 3 | 4 | include_directories(${CMAKE_SOURCE_DIR}/include/RTI13) 5 | include_directories(${CMAKE_BINARY_DIR}/src/OpenRTI) 6 | include_directories(${CMAKE_SOURCE_DIR}/src/OpenRTI) 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) 8 | 9 | # Test directories should be listed here in sensible testing order 10 | add_subdirectory(link) 11 | add_subdirectory(fddget) 12 | add_subdirectory(time) 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/Dimension1-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Dimension1 9 | 1 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/Dimension1-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Dimension1 9 | 2 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/Dimension2-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Dimension2 9 | 2 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/Dimension2-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Dimension2 9 | 3 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/rti1516e/time/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(logical-time-1516e logical-time.cpp) 2 | target_link_libraries(logical-time-1516e fedtime1516e OpenRTI) 3 | 4 | # Test the different logical times by getting the values form the logical time factory 5 | add_test(rti1516e/logical-time-1516e-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/logical-time-1516e") 6 | add_test(rti1516e/logical-time-1516e-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/logical-time-1516e" -F HLAfloat64Time) 7 | add_test(rti1516e/logical-time-1516e-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/logical-time-1516e" -F HLAinteger64Time) 8 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass1 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass3.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass3 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass1 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass3.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass3 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass1-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass1 11 | 12 | Attribute1 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass3-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass3 11 | 12 | Attribute3 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass1-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass1 11 | 12 | OtherAttribute1 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass3-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass3 11 | 12 | OtherAttribute3 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass1 11 | 12 | ObjectClass2 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass1-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass1 11 | 12 | Parameter1 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass3-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass3 11 | 12 | Parameter3 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass1-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass1 11 | 12 | OtherParameter1 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass3-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass3 11 | 12 | OtherParameter3 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/RTI13/fddget/fdd-2.fed: -------------------------------------------------------------------------------- 1 | (FED 2 | (Federation test) 3 | (FEDversion v1.3) 4 | (objects 5 | (class ObjectClass1 6 | (attribute Attribute1 reliable TimeStamp) 7 | (class ObjectClass2 8 | (attribute Attribute2 reliable TimeStamp) 9 | ) 10 | ) 11 | (class ObjectClass3 12 | (attribute Attribute3 reliable TimeStamp) 13 | ) 14 | ) 15 | (interactions 16 | (class InteractionClass1 reliable TimeStamp 17 | (parameter Parameter1) 18 | (class InteractionClass2 reliable TimeStamp 19 | (parameter Parameter2) 20 | ) 21 | ) 22 | (class InteractionClass3 reliable TimeStamp 23 | (parameter Parameter3) 24 | ) 25 | ) 26 | ) 27 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass1 11 | 12 | InteractionClass2 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass2-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass1 11 | 12 | ObjectClass2 13 | 14 | Attribute2 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/ObjectClass2-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAobjectRoot 9 | 10 | ObjectClass1 11 | 12 | ObjectClass2 13 | 14 | OtherAttribute2 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/rti1516e/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The current standard fdd used for testing 2 | set(RTI1516E_FDD_FILE ${CMAKE_SOURCE_DIR}/share/rti1516e/HLAstandardMIM.xml) 3 | 4 | include_directories(${CMAKE_SOURCE_DIR}/include/rti1516e) 5 | include_directories(${CMAKE_BINARY_DIR}/src/OpenRTI) 6 | include_directories(${CMAKE_SOURCE_DIR}/src/OpenRTI) 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) 8 | 9 | if(NOT OPENRTI_BUILD_SHARED) 10 | add_definitions(-DSTATIC_RTI) 11 | add_definitions(-DSTATIC_FEDTIME) 12 | endif() 13 | 14 | # Test directories should be listed here in sensible testing order 15 | add_subdirectory(link) 16 | add_subdirectory(encode) 17 | add_subdirectory(fddget) 18 | add_subdirectory(time) 19 | add_subdirectory(modules) 20 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass2-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass1 11 | 12 | InteractionClass2 13 | 14 | Parameter2 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/InteractionClass2-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | HLAinteractionRoot 9 | 10 | InteractionClass1 11 | 12 | InteractionClass2 13 | 14 | OtherParameter2 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/rtinode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # All the -I arguments 2 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 3 | # The OpenRTI implementation files and may be build generated sources 4 | include_directories(${CMAKE_BINARY_DIR}/src/OpenRTI) 5 | include_directories(${CMAKE_SOURCE_DIR}/src/OpenRTI) 6 | 7 | # The standalone main server application 8 | add_executable(rtinode rtinode.cpp) 9 | if(OPENRTI_INSTALL_WITH_RPATH) 10 | set_property(TARGET rtinode PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") 11 | # set_property(TARGET rtinode PROPERTY INSTALL_RPATH "\\\${ORIGIN}/../${CMAKE_INSTALL_LIBDIR}") 12 | set_property(TARGET rtinode APPEND PROPERTY LINK_FLAGS "${OPENRTI_RPATH_LINK_FLAGS}") 13 | endif() 14 | target_link_libraries(rtinode OpenRTI) 15 | 16 | install(TARGETS rtinode 17 | RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") 18 | -------------------------------------------------------------------------------- /tests/rti1516/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The current standard fdd used for testing 2 | set(RTI1516_FDD_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fdd.xml) 3 | 4 | include_directories(${CMAKE_SOURCE_DIR}/include/rti1516) 5 | include_directories(${CMAKE_BINARY_DIR}/src/OpenRTI) 6 | include_directories(${CMAKE_SOURCE_DIR}/src/OpenRTI) 7 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) 8 | 9 | if(NOT OPENRTI_BUILD_SHARED) 10 | add_definitions(-DSTATIC_RTI) 11 | add_definitions(-DSTATIC_FEDTIME) 12 | endif() 13 | 14 | # Test directories should be listed here in sensible testing order 15 | add_subdirectory(link) 16 | add_subdirectory(connect) 17 | add_subdirectory(create) 18 | add_subdirectory(join) 19 | add_subdirectory(fddget) 20 | add_subdirectory(sync) 21 | add_subdirectory(time) 22 | add_subdirectory(interaction) 23 | add_subdirectory(objectinstance) 24 | -------------------------------------------------------------------------------- /src/OpenRTI/xml/winconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | */ 9 | 10 | #ifndef WINCONFIG_H 11 | #define WINCONFIG_H 12 | 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | #undef WIN32_LEAN_AND_MEAN 16 | 17 | #include 18 | #include 19 | 20 | #define XML_NS 1 21 | #define XML_DTD 1 22 | #define XML_CONTEXT_BYTES 1024 23 | 24 | /* we will assume all Windows platforms are little endian */ 25 | #define BYTEORDER 1234 26 | 27 | /* Windows has memmove() available. */ 28 | #define HAVE_MEMMOVE 29 | 30 | #endif /* ndef WINCONFIG_H */ 31 | -------------------------------------------------------------------------------- /src/OpenRTI/xml/amigaconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef AMIGACONFIG_H 2 | #define AMIGACONFIG_H 3 | 4 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 5 | #define BYTEORDER 4321 6 | 7 | /* Define to 1 if you have the `bcopy' function. */ 8 | #define HAVE_BCOPY 1 9 | 10 | /* Define to 1 if you have the `memmove' function. */ 11 | #define HAVE_MEMMOVE 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_UNISTD_H 1 15 | 16 | /* whether byteorder is bigendian */ 17 | #define WORDS_BIGENDIAN 18 | 19 | /* Define to specify how much context to retain around the current parse 20 | point. */ 21 | #define XML_CONTEXT_BYTES 1024 22 | 23 | /* Define to make parameter entity parsing functionality available. */ 24 | #define XML_DTD 25 | 26 | /* Define to make XML Namespaces functionality available. */ 27 | #define XML_NS 28 | 29 | #endif /* AMIGACONFIG_H */ 30 | -------------------------------------------------------------------------------- /tests/rti1516/fddget/fdd-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/rtinode/rtinode-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/OpenRTI/xml/xmltok_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 | See the file COPYING for copying permission. 4 | */ 5 | 6 | enum { 7 | BT_NONXML, 8 | BT_MALFORM, 9 | BT_LT, 10 | BT_AMP, 11 | BT_RSQB, 12 | BT_LEAD2, 13 | BT_LEAD3, 14 | BT_LEAD4, 15 | BT_TRAIL, 16 | BT_CR, 17 | BT_LF, 18 | BT_GT, 19 | BT_QUOT, 20 | BT_APOS, 21 | BT_EQUALS, 22 | BT_QUEST, 23 | BT_EXCL, 24 | BT_SOL, 25 | BT_SEMI, 26 | BT_NUM, 27 | BT_LSQB, 28 | BT_S, 29 | BT_NMSTRT, 30 | BT_COLON, 31 | BT_HEX, 32 | BT_DIGIT, 33 | BT_NAME, 34 | BT_MINUS, 35 | BT_OTHER, /* known not to be a name or name start character */ 36 | BT_NONASCII, /* might be a name or name start character */ 37 | BT_PERCNT, 38 | BT_LPAR, 39 | BT_RPAR, 40 | BT_AST, 41 | BT_PLUS, 42 | BT_COMMA, 43 | BT_VERBAR 44 | }; 45 | 46 | #include 47 | -------------------------------------------------------------------------------- /tests/RTI13/fddget/fdd-1.fed: -------------------------------------------------------------------------------- 1 | (FED 2 | (Federation test) 3 | (FEDversion v1.3) 4 | (objects 5 | (class objectRoot 6 | (attribute privilegeToDelete reliable TimeStamp) 7 | (class ObjectClass1 8 | (attribute Attribute1 reliable TimeStamp) 9 | (class ObjectClass2 10 | (attribute Attribute2 reliable TimeStamp) 11 | ) 12 | ) 13 | (class ObjectClass3 14 | (attribute Attribute3 reliable TimeStamp) 15 | ) 16 | ) 17 | ) 18 | (interactions 19 | (class interactionRoot reliable TimeStamp 20 | (class InteractionClass1 reliable TimeStamp 21 | (parameter Parameter1) 22 | (class InteractionClass2 reliable TimeStamp 23 | (parameter Parameter2) 24 | ) 25 | ) 26 | (class InteractionClass3 reliable TimeStamp 27 | (parameter Parameter3) 28 | ) 29 | ) 30 | ) 31 | ) 32 | -------------------------------------------------------------------------------- /python/rti1516/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rti1516 includes 2 | include_directories(${CMAKE_SOURCE_DIR}/include/rti1516) 3 | 4 | add_library(rti1516_py MODULE Module.cpp) 5 | set_property(TARGET rti1516_py PROPERTY PREFIX "") 6 | set_property(TARGET rti1516_py PROPERTY OUTPUT_NAME "rti1516") 7 | if(WIN32) 8 | set_property(TARGET rti1516_py PROPERTY SUFFIX ".pyd") 9 | endif() 10 | target_link_libraries(rti1516_py rti1516 fedtime1516 Python::Python) 11 | 12 | if(OPENRTI_BUILD_SHARED) 13 | if(OPENRTI_INSTALL_WITH_RPATH) 14 | set_property(TARGET rti1516_py PROPERTY INSTALL_RPATH "$ORIGIN/../..") 15 | set_property(TARGET rti1516_py APPEND PROPERTY LINK_FLAGS "${OPENRTI_RPATH_LINK_FLAGS}") 16 | endif() 17 | endif() 18 | 19 | install(TARGETS rti1516_py 20 | RUNTIME DESTINATION "${INSTALL_PYTHON_DIRECTORY}" 21 | LIBRARY DESTINATION "${INSTALL_PYTHON_DIRECTORY}" 22 | ARCHIVE DESTINATION "${INSTALL_PYTHON_DIRECTORY}") 23 | -------------------------------------------------------------------------------- /tests/rti1516/sync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(sync-1516 sync.cpp) 2 | target_link_libraries(sync-1516 rti1516 fedtime1516 OpenRTI) 3 | 4 | # No server - thread protocol, one ambassador 5 | add_test(rti1516/sync-1516-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sync-1516" -S0 -A1 -O "${RTI1516_FDD_FILE}") 6 | # No server - thread protocol, 10 ambassadors 7 | add_test(rti1516/sync-1516-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sync-1516" -S0 -A10 -O "${RTI1516_FDD_FILE}") 8 | # 1 server - rti protocol, one ambassador 9 | add_test(rti1516/sync-1516-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sync-1516" -S1 -A1 -O "${RTI1516_FDD_FILE}") 10 | # 1 server - rti protocol, 10 ambassadors 11 | add_test(rti1516/sync-1516-4 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sync-1516" -S1 -A10 -O "${RTI1516_FDD_FILE}") 12 | # 5 servers - rti protocol, 10 ambassadors 13 | add_test(rti1516/sync-1516-5 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/sync-1516" -S5 -A10 -O "${RTI1516_FDD_FILE}") 14 | -------------------------------------------------------------------------------- /python/rti1516e/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The rti1516e includes 2 | include_directories(${CMAKE_SOURCE_DIR}/include/rti1516e) 3 | 4 | add_library(rti1516e_py MODULE Module.cpp) 5 | set_property(TARGET rti1516e_py PROPERTY PREFIX "") 6 | set_property(TARGET rti1516e_py PROPERTY OUTPUT_NAME "rti1516e") 7 | if(WIN32) 8 | set_property(TARGET rti1516e_py PROPERTY SUFFIX ".pyd") 9 | endif() 10 | target_link_libraries(rti1516e_py rti1516e fedtime1516e Python::Python) 11 | 12 | if(OPENRTI_BUILD_SHARED) 13 | if(OPENRTI_INSTALL_WITH_RPATH) 14 | set_property(TARGET rti1516e_py PROPERTY INSTALL_RPATH "$ORIGIN/../..") 15 | set_property(TARGET rti1516e_py APPEND PROPERTY LINK_FLAGS "${OPENRTI_RPATH_LINK_FLAGS}") 16 | endif() 17 | endif() 18 | 19 | install(TARGETS rti1516e_py 20 | RUNTIME DESTINATION "${INSTALL_PYTHON_DIRECTORY}" 21 | LIBRARY DESTINATION "${INSTALL_PYTHON_DIRECTORY}" 22 | ARCHIVE DESTINATION "${INSTALL_PYTHON_DIRECTORY}") 23 | -------------------------------------------------------------------------------- /src/rti1516e/NullFederateAmbassador.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | namespace rti1516e 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /include/RTI13/baseTypes.hh: -------------------------------------------------------------------------------- 1 | // HLA 1.3 Header "baseTypes.hh" 2 | 3 | typedef unsigned short UShort; 4 | typedef short Short; 5 | typedef unsigned int ULong; 6 | typedef int Long; 7 | typedef double Double; 8 | typedef float Float; 9 | 10 | enum Boolean { 11 | RTI_FALSE = 0, 12 | RTI_TRUE 13 | }; 14 | 15 | class RTI_EXPORT Exception 16 | { 17 | public: 18 | ULong _serial; 19 | const char* _reason; 20 | const char* _name; 21 | Exception(const char* reason); 22 | Exception(ULong serial, const char* reason); 23 | Exception(const Exception& toCopy); 24 | virtual ~Exception(); 25 | Exception& operator=(const Exception&); 26 | }; 27 | 28 | #define RTI_EXCEPT(A) \ 29 | class A : public Exception { \ 30 | public: \ 31 | A (const char *reason) : Exception(reason) { _name = #A; } \ 32 | A (ULong serial, const char *reason = 0) \ 33 | : Exception(serial, reason) { _name = #A; } \ 34 | A (A const &toCopy) : Exception(toCopy) { _name = #A; } \ 35 | }; 36 | -------------------------------------------------------------------------------- /src/rti1516e/LogicalTimeFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | namespace rti1516e { 23 | 24 | LogicalTimeFactory::~LogicalTimeFactory() 25 | RTI_NOEXCEPT 26 | { 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/OpenRTI/Attributes.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "Attributes.h" 21 | 22 | namespace OpenRTI { 23 | namespace XML { 24 | 25 | Attributes::~Attributes(void) 26 | { 27 | } 28 | 29 | } // namespace XML 30 | } // namespace OpenRTI 31 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/SocketUDPWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketUDP.h" 21 | 22 | namespace OpenRTI { 23 | 24 | SocketUDP::SocketUDP() : 25 | SocketPacket(0) 26 | { 27 | } 28 | 29 | SocketUDP::~SocketUDP() 30 | { 31 | } 32 | 33 | } // namespace OpenRTI 34 | -------------------------------------------------------------------------------- /include/rti1516/RTI/RTIambassadorFactory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | IEEE 1516.1 High Level Architecture Interface Specification C++ API 3 | File: RTI/RTIambassadorFactory.h 4 | ***********************************************************************/ 5 | 6 | #ifndef RTI_RTIambassadorFactory_h 7 | #define RTI_RTIambassadorFactory_h 8 | 9 | namespace rti1516 10 | { 11 | class RTIambassador; 12 | } 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | namespace rti1516 21 | { 22 | class RTI_EXPORT RTIambassadorFactory 23 | { 24 | public: 25 | RTIambassadorFactory(); 26 | 27 | virtual 28 | ~RTIambassadorFactory() 29 | RTI_NOEXCEPT; 30 | 31 | // 10.35 32 | RTI_UNIQUE_PTR< RTIambassador > 33 | createRTIambassador(std::vector< std::wstring > & args) 34 | RTI_THROW ((BadInitializationParameter, 35 | RTIinternalError)); 36 | }; 37 | } 38 | 39 | #endif // RTI_RTIambassadorFactory_h 40 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/ErrnoWin32.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_ErrnoWin32_h 21 | #define OpenRTI_ErrnoWin32_h 22 | 23 | #include 24 | 25 | namespace OpenRTI { 26 | 27 | std::string errnoToUtf8(int errorNumber); 28 | 29 | } // namespace OpenRTI 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractServerNode.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "AbstractServerNode.h" 21 | 22 | namespace OpenRTI { 23 | 24 | AbstractServerNode::AbstractServerNode() 25 | { 26 | } 27 | 28 | AbstractServerNode::~AbstractServerNode() 29 | { 30 | } 31 | 32 | } // namespace OpenRTI 33 | -------------------------------------------------------------------------------- /src/rti1516/NullFederateAmbassador.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | namespace rti1516 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/SocketDataWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketData.h" 21 | 22 | namespace OpenRTI { 23 | 24 | SocketData::SocketData(PrivateData* privateData) : 25 | Socket(privateData) 26 | { 27 | } 28 | 29 | SocketData::~SocketData() 30 | { 31 | } 32 | 33 | } // namespace OpenRTI 34 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractMessageSender.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "AbstractMessageSender.h" 21 | 22 | namespace OpenRTI { 23 | 24 | AbstractMessageSender::AbstractMessageSender() 25 | { 26 | } 27 | 28 | AbstractMessageSender::~AbstractMessageSender() 29 | { 30 | } 31 | 32 | } // namespace OpenRTI 33 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractProtocolLayer.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "AbstractProtocolLayer.h" 21 | 22 | namespace OpenRTI { 23 | 24 | AbstractProtocolLayer::AbstractProtocolLayer() 25 | { 26 | } 27 | 28 | AbstractProtocolLayer::~AbstractProtocolLayer() 29 | { 30 | } 31 | 32 | } // namespace OpenRTI 33 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractProtocolSocket.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "AbstractProtocolSocket.h" 21 | 22 | namespace OpenRTI { 23 | 24 | AbstractProtocolSocket::AbstractProtocolSocket() 25 | { 26 | } 27 | 28 | AbstractProtocolSocket::~AbstractProtocolSocket() 29 | { 30 | } 31 | 32 | } // namespace OpenRTI 33 | -------------------------------------------------------------------------------- /src/OpenRTI/posix/SocketUDPPosix.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketUDP.h" 21 | #include "SocketPrivateDataPosix.h" 22 | 23 | namespace OpenRTI { 24 | 25 | SocketUDP::SocketUDP() : 26 | SocketPacket(0) 27 | { 28 | } 29 | 30 | SocketUDP::~SocketUDP() 31 | { 32 | } 33 | 34 | } // namespace OpenRTI 35 | -------------------------------------------------------------------------------- /src/OpenRTI/posix/SocketDataPosix.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketData.h" 21 | #include "SocketPrivateDataPosix.h" 22 | 23 | namespace OpenRTI { 24 | 25 | SocketData::SocketData(PrivateData* privateData) : 26 | Socket(privateData) 27 | { 28 | } 29 | 30 | SocketData::~SocketData() 31 | { 32 | } 33 | 34 | } // namespace OpenRTI 35 | -------------------------------------------------------------------------------- /src/rti1516e/FederateAmbassador.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | namespace rti1516e 23 | { 24 | 25 | FederateAmbassador::FederateAmbassador() 26 | RTI_THROW ((FederateInternalError)) 27 | { 28 | } 29 | 30 | FederateAmbassador::~FederateAmbassador() 31 | RTI_NOEXCEPT 32 | { 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/rti1516/interaction/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Query something from an fdd 2 | add_executable(interaction-1516 interaction.cpp) 3 | target_link_libraries(interaction-1516 rti1516 fedtime1516 OpenRTI) 4 | 5 | # No server - thread protocol, one ambassador 6 | add_test(rti1516/interaction-1516-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/interaction-1516" -S0 -A1 -O "${CMAKE_CURRENT_SOURCE_DIR}/fdd.xml") 7 | # No server - thread protocol, 10 ambassadors 8 | add_test(rti1516/interaction-1516-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/interaction-1516" -S0 -A10 -O "${CMAKE_CURRENT_SOURCE_DIR}/fdd.xml") 9 | # 1 server - rti protocol, one ambassador 10 | add_test(rti1516/interaction-1516-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/interaction-1516" -S1 -A1 -J -O "${CMAKE_CURRENT_SOURCE_DIR}/fdd.xml") 11 | # 1 server - rti protocol, 10 ambassadors 12 | add_test(rti1516/interaction-1516-4 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/interaction-1516" -S1 -A10 -J -O "${CMAKE_CURRENT_SOURCE_DIR}/fdd.xml") 13 | # 5 servers - rti protocol, 10 ambassadors 14 | add_test(rti1516/interaction-1516-5 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/interaction-1516" -S5 -A10 -J -O "${CMAKE_CURRENT_SOURCE_DIR}/fdd.xml") 15 | -------------------------------------------------------------------------------- /tests/rti1516/fddget/fdd-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /tests/RTI13/link/link.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2013-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | int 28 | main(int argc, char* argv[]) 29 | { 30 | RTI_UNIQUE_PTR ambassador; 31 | ambassador.reset(new RTI::RTIambassador); 32 | return EXIT_SUCCESS; 33 | } 34 | -------------------------------------------------------------------------------- /src/rti1516/LogicalTimeFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | namespace rti1516 { 27 | 28 | LogicalTimeFactory::~LogicalTimeFactory() 29 | RTI_NOEXCEPT 30 | { 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /include/rti1516/RTI/RangeBounds.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | IEEE 1516.1 High Level Architecture Interface Specification C++ API 3 | File: RTI/RangeBounds.h 4 | ***********************************************************************/ 5 | 6 | #ifndef RTI_RangeBounds_h 7 | #define RTI_RangeBounds_h 8 | 9 | #include 10 | 11 | namespace rti1516 12 | { 13 | class RTI_EXPORT RangeBounds 14 | { 15 | public: 16 | RangeBounds(); 17 | 18 | RangeBounds(unsigned long lowerBound, 19 | unsigned long upperBound); 20 | 21 | ~RangeBounds() 22 | RTI_NOEXCEPT; 23 | 24 | RangeBounds(RangeBounds const & rhs); 25 | 26 | RangeBounds & 27 | operator=(RangeBounds const & rhs); 28 | 29 | unsigned long 30 | getLowerBound() const; 31 | 32 | unsigned long 33 | getUpperBound() const; 34 | 35 | void 36 | setLowerBound(unsigned long lowerBound); 37 | 38 | void 39 | setUpperBound(unsigned long upperBound); 40 | 41 | private: 42 | unsigned long _lowerBound; 43 | unsigned long _upperBound; 44 | }; 45 | } 46 | 47 | #endif // RTI_RangeBounds_h 48 | -------------------------------------------------------------------------------- /src/OpenRTI/posix/ErrnoPosix.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_ErrnoPosix_h 21 | #define OpenRTI_ErrnoPosix_h 22 | 23 | #include 24 | #include 25 | #include "StringUtils.h" 26 | 27 | namespace OpenRTI { 28 | 29 | inline std::string errnoToUtf8(int errorNumber) 30 | { 31 | return localeToUtf8(strerror(errorNumber)); 32 | } 33 | 34 | } // namespace OpenRTI 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/rti1516/RTIambassador.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | namespace rti1516 27 | { 28 | 29 | RTIambassador::RTIambassador() 30 | RTI_NOEXCEPT 31 | { 32 | } 33 | 34 | RTIambassador::~RTIambassador() 35 | { 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/rti1516e/Encoding.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2011-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef Encoding_h 21 | #define Encoding_h 22 | 23 | static inline size_t align(size_t offset, size_t octetBoundary) 24 | { return (offset + octetBoundary - 1) & ~(octetBoundary - 1); } 25 | static inline void align(std::vector& buffer, size_t octetBoundary) 26 | { buffer.resize(align(buffer.size(), octetBoundary), 0); } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/OpenRTI/FEDFileReader.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_FEDFileReader_h 21 | #define OpenRTI_FEDFileReader_h 22 | 23 | #include 24 | #include "Export.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class FOMStringModule; 29 | 30 | class OPENRTI_API FEDFileReader { 31 | public: 32 | static FOMStringModule read(std::istream& stream); 33 | }; 34 | 35 | } // namespace OpenRTI 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/rti1516e/EncodingExceptions.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2011-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace rti1516e 25 | { 26 | 27 | EncoderException::EncoderException(std::wstring const& message) RTI_NOEXCEPT : 28 | _msg(message) 29 | { 30 | } 31 | 32 | std::wstring EncoderException::what () const RTI_NOEXCEPT 33 | { 34 | return _msg; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/rti1516e/RTIambassador.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // because of auto_ptr in the ambassador header 22 | #include 23 | 24 | #include 25 | 26 | namespace rti1516e 27 | { 28 | 29 | RTIambassador::RTIambassador() 30 | RTI_NOEXCEPT 31 | { 32 | } 33 | 34 | RTIambassador::~RTIambassador() 35 | { 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/rti1516e/LogicalTime.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | namespace rti1516e 26 | { 27 | 28 | LogicalTime::~LogicalTime() 29 | RTI_NOEXCEPT 30 | { 31 | } 32 | 33 | std::wostream& 34 | operator<<(std::wostream& stream, LogicalTime const& logicalTime) 35 | { 36 | return stream << logicalTime.toString(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /tests/rti1516e/link/link.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2013-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | int 27 | main(int argc, char* argv[]) 28 | { 29 | RTI_UNIQUE_PTR ambassador; 30 | rti1516e::RTIambassadorFactory factory; 31 | ambassador = factory.createRTIambassador(); 32 | return EXIT_SUCCESS; 33 | } 34 | -------------------------------------------------------------------------------- /src/rti1516e/LogicalTimeFactoryFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | namespace rti1516e { 26 | 27 | RTI_UNIQUE_PTR 28 | LogicalTimeFactoryFactory::makeLogicalTimeFactory(const std::wstring& implementationName) 29 | { 30 | return HLAlogicalTimeFactoryFactory::makeLogicalTimeFactory(implementationName); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/rti1516e/Version.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include "OpenRTIConfig.h" 22 | 23 | #define PASTE2(a, b) a##b 24 | #define PASTE(a, b) PASTE2(a, b) 25 | 26 | namespace rti1516e 27 | { 28 | 29 | std::wstring 30 | rtiName() 31 | { 32 | return std::wstring(L"OpenRTI"); 33 | } 34 | 35 | std::wstring 36 | rtiVersion() 37 | { 38 | return std::wstring(PASTE(L, OpenRTI_VERSION_STRING)); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractMessage.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "AbstractMessage.h" 21 | 22 | namespace OpenRTI { 23 | 24 | AbstractMessage::~AbstractMessage() 25 | { 26 | } 27 | 28 | bool 29 | AbstractMessage::getReliable() const 30 | { 31 | return true; 32 | } 33 | 34 | ObjectInstanceHandle 35 | AbstractMessage::getObjectInstanceHandleForMessage() const 36 | { 37 | return ObjectInstanceHandle(); 38 | } 39 | 40 | } // namespace OpenRTI 41 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractLogicalTime.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_AbstractLogicalTime_h 21 | #define OpenRTI_AbstractLogicalTime_h 22 | 23 | #include "Referenced.h" 24 | 25 | namespace OpenRTI { 26 | 27 | class AbstractLogicalTime : public Referenced { 28 | public: 29 | virtual ~AbstractLogicalTime() {} 30 | virtual bool operator<(const AbstractLogicalTime& logicalTime) const = 0; 31 | }; 32 | 33 | } // namespace OpenRTI 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/rti1516e/LogicalTimeInterval.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | namespace rti1516e 26 | { 27 | 28 | LogicalTimeInterval::~LogicalTimeInterval() 29 | RTI_NOEXCEPT 30 | { 31 | } 32 | 33 | std::wostream& 34 | operator<<(std::wostream& stream, LogicalTimeInterval const& logicalTimeInterval) 35 | { 36 | return stream << logicalTimeInterval.toString(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/OpenRTI/FDD1516FileReader.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_FDD1516FileReader_h 21 | #define OpenRTI_FDD1516FileReader_h 22 | 23 | #include 24 | #include 25 | #include "Export.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class FOMStringModule; 30 | 31 | class OPENRTI_API FDD1516FileReader { 32 | public: 33 | static FOMStringModule read(std::istream& stream, const std::string& encoding); 34 | }; 35 | 36 | } // namespace OpenRTI 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/rti1516/FederateAmbassador.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | namespace rti1516 27 | { 28 | 29 | FederateAmbassador::FederateAmbassador() 30 | RTI_THROW ((FederateInternalError)) 31 | { 32 | } 33 | 34 | FederateAmbassador::~FederateAmbassador() 35 | RTI_NOEXCEPT 36 | { 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/OpenRTI/FDD1516EFileReader.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_FDD1516EFileReader_h 21 | #define OpenRTI_FDD1516EFileReader_h 22 | 23 | #include 24 | #include 25 | #include "Export.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class FOMStringModule; 30 | 31 | class OPENRTI_API FDD1516EFileReader { 32 | public: 33 | static FOMStringModule read(std::istream& stream, const std::string& encoding); 34 | }; 35 | 36 | } // namespace OpenRTI 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /tests/rti1516/link/link.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2013-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | int 28 | main(int argc, char* argv[]) 29 | { 30 | RTI_UNIQUE_PTR ambassador; 31 | rti1516::RTIambassadorFactory factory; 32 | std::vector args; 33 | ambassador = factory.createRTIambassador(args); 34 | return EXIT_SUCCESS; 35 | } 36 | -------------------------------------------------------------------------------- /src/OpenRTI/xml/COPYING-expat: -------------------------------------------------------------------------------- 1 | Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd 2 | and Clark Cooper 3 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/OpenRTI/InternalTimeManagement.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "InternalTimeManagement.h" 21 | 22 | namespace OpenRTI { 23 | 24 | InternalTimeManagement::InternalTimeManagement() : 25 | _timeRegulationMode(TimeRegulationDisabled), 26 | _timeConstrainedMode(TimeConstrainedDisabled), 27 | _timeAdvanceMode(TimeAdvanceGranted), 28 | _asynchronousDeliveryEnabled(false), 29 | _messageRetractionSerial(0) 30 | { 31 | } 32 | 33 | InternalTimeManagement::~InternalTimeManagement() 34 | { 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/OpenRTI/ErrorHandler.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "ErrorHandler.h" 21 | 22 | namespace OpenRTI { 23 | namespace XML { 24 | 25 | ErrorHandler::~ErrorHandler(void) 26 | { 27 | } 28 | 29 | void 30 | ErrorHandler::error(const char* msg, unsigned line, unsigned col) 31 | { 32 | } 33 | 34 | void 35 | ErrorHandler::fatalError(const char* msg, unsigned line, unsigned col) 36 | { 37 | } 38 | 39 | void 40 | ErrorHandler::warning(const char* msg, unsigned line, unsigned col) 41 | { 42 | } 43 | 44 | } // namespace XML 45 | } // namespace OpenRTI 46 | -------------------------------------------------------------------------------- /src/rti1516/LogicalTime.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | namespace rti1516 30 | { 31 | 32 | LogicalTime::~LogicalTime() 33 | RTI_NOEXCEPT 34 | { 35 | } 36 | 37 | std::wostream& 38 | operator<<(std::wostream& stream, LogicalTime const& logicalTime) 39 | { 40 | return stream << logicalTime.toString(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/OpenRTI/ExpatXMLReader.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_XML_ExpatXMLReader_h 21 | #define OpenRTI_XML_ExpatXMLReader_h 22 | 23 | #include "XMLReader.h" 24 | 25 | namespace OpenRTI { 26 | namespace XML { 27 | 28 | class ExpatXMLReader : public XMLReader { 29 | public: 30 | ExpatXMLReader(void); 31 | virtual ~ExpatXMLReader(void); 32 | // returns bool instead of void to signal errors 33 | virtual void parse(std::istream& stream, const std::string& encoding); 34 | }; 35 | 36 | } // namespace XML 37 | } // namespace OpenRTI 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractProtocol.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_AbstractProtocol_h 21 | #define OpenRTI_AbstractProtocol_h 22 | 23 | #include "AbstractConnect.h" 24 | #include "StringUtils.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class Clock; 29 | 30 | class OPENRTI_API AbstractProtocol : public Referenced { 31 | public: 32 | virtual ~AbstractProtocol() 33 | { } 34 | 35 | virtual SharedPtr connect(const StringStringListMap& clientOptions, const Clock& abstime) const = 0; 36 | }; 37 | 38 | } // namespace OpenRTI 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/OpenRTI/ScopeUnlock.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_ScopeUnlock_h 21 | #define OpenRTI_ScopeUnlock_h 22 | 23 | #include "Mutex.h" 24 | 25 | namespace OpenRTI { 26 | 27 | class ScopeUnlock { 28 | public: 29 | ScopeUnlock(Mutex& mutex) : mMutex(mutex) 30 | { mMutex.unlock(); } 31 | ~ScopeUnlock(void) 32 | { mMutex.lock(); } 33 | 34 | private: 35 | ScopeUnlock(void); 36 | ScopeUnlock(const ScopeUnlock&); 37 | ScopeUnlock& operator=(const ScopeUnlock&); 38 | 39 | Mutex& mMutex; 40 | }; 41 | 42 | } // namespace OpenRTI 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/MutexWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "Mutex.h" 21 | 22 | #include "MutexPrivateDataWin32.h" 23 | 24 | namespace OpenRTI { 25 | 26 | #if __cplusplus < 201103L 27 | Mutex::Mutex(void) : 28 | _privateData(new PrivateData) 29 | { 30 | } 31 | 32 | Mutex::~Mutex(void) 33 | { 34 | delete _privateData; 35 | _privateData = 0; 36 | } 37 | 38 | void 39 | Mutex::lock(void) 40 | { 41 | _privateData->lock(); 42 | } 43 | 44 | void 45 | Mutex::unlock(void) 46 | { 47 | _privateData->unlock(); 48 | } 49 | 50 | #endif 51 | 52 | } // namespace OpenRTI 53 | -------------------------------------------------------------------------------- /src/rti1516/Version.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | #include "OpenRTIConfig.h" 26 | 27 | #define PASTE2(a, b) a##b 28 | #define PASTE(a, b) PASTE2(a, b) 29 | 30 | namespace rti1516 31 | { 32 | 33 | std::wstring 34 | RTIname() 35 | { 36 | return std::wstring(L"OpenRTI"); 37 | } 38 | 39 | std::wstring 40 | RTIversion() 41 | { 42 | return std::wstring(PASTE(L, OpenRTI_VERSION_STRING)); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketServer.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketServer_h 21 | #define OpenRTI_SocketServer_h 22 | 23 | #include "Export.h" 24 | #include "Socket.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class SocketAddress; 29 | class SocketStream; 30 | 31 | class OPENRTI_API SocketServer : public Socket { 32 | public: 33 | virtual SocketStream* accept() = 0; 34 | 35 | SocketAddress getsockname() const; 36 | 37 | protected: 38 | SocketServer(PrivateData* privateData); 39 | virtual ~SocketServer(); 40 | }; 41 | 42 | } // namespace OpenRTI 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/OpenRTI/posix/MutexPosix.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "Mutex.h" 21 | 22 | #include "MutexPrivateDataPosix.h" 23 | 24 | namespace OpenRTI { 25 | 26 | #if __cplusplus < 201103L 27 | 28 | Mutex::Mutex(void) : 29 | _privateData(new PrivateData) 30 | { 31 | } 32 | 33 | Mutex::~Mutex(void) 34 | { 35 | delete _privateData; 36 | _privateData = 0; 37 | } 38 | 39 | void 40 | Mutex::lock(void) 41 | { 42 | _privateData->lock(); 43 | } 44 | 45 | void 46 | Mutex::unlock(void) 47 | { 48 | _privateData->unlock(); 49 | } 50 | 51 | #endif 52 | 53 | } // namespace OpenRTI 54 | -------------------------------------------------------------------------------- /src/OpenRTI/Rand.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2011-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_Rand_h 21 | #define OpenRTI_Rand_h 22 | 23 | #include "Export.h" 24 | #include "Types.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class OPENRTI_LOCAL Rand { 29 | public: 30 | Rand(uint32_t w = 1, uint32_t z = 2) : 31 | _w(w), _z(z) 32 | { } 33 | 34 | uint32_t get() 35 | { 36 | _z = 36969 * (_z & 65535) + (_z >> 16); 37 | _w = 18000 * (_w & 65535) + (_w >> 16); 38 | return (_z << 16) + _w; 39 | } 40 | 41 | private: 42 | uint32_t _w; 43 | uint32_t _z; 44 | }; 45 | 46 | } // namespace OpenRTI 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/rti1516/LogicalTimeInterval.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | namespace rti1516 30 | { 31 | 32 | LogicalTimeInterval::~LogicalTimeInterval() 33 | RTI_NOEXCEPT 34 | { 35 | } 36 | 37 | std::wostream& 38 | operator<<(std::wostream& stream, LogicalTimeInterval const& logicalTimeInterval) 39 | { 40 | return stream << logicalTimeInterval.toString(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/rti1516e/RTIambassadorFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include "RTIambassadorImplementation.h" 22 | 23 | #include 24 | 25 | namespace rti1516e 26 | { 27 | 28 | RTIambassadorFactory::RTIambassadorFactory() 29 | { 30 | } 31 | 32 | RTIambassadorFactory::~RTIambassadorFactory() 33 | RTI_NOEXCEPT 34 | { 35 | } 36 | 37 | RTI_UNIQUE_PTR 38 | RTIambassadorFactory::createRTIambassador() 39 | RTI_THROW ((RTIinternalError)) 40 | { 41 | return RTI_UNIQUE_PTR(new OpenRTI::RTIambassadorImplementation); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketPipe.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketPipe_h 21 | #define OpenRTI_SocketPipe_h 22 | 23 | #include 24 | #include "SocketStream.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class SocketServerPipe; 29 | 30 | class OPENRTI_API SocketPipe : public SocketStream { 31 | public: 32 | SocketPipe(); 33 | 34 | void connect(const std::string& file); 35 | virtual void shutdown(); 36 | 37 | protected: 38 | SocketPipe(PrivateData* privateData); 39 | virtual ~SocketPipe(); 40 | 41 | friend class SocketServerPipe; 42 | }; 43 | 44 | } // namespace OpenRTI 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/OpenRTI/ErrorHandler.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_XML_ErrorHandler_h 21 | #define OpenRTI_XML_ErrorHandler_h 22 | 23 | #include "Referenced.h" 24 | 25 | namespace OpenRTI { 26 | namespace XML { 27 | 28 | class ErrorHandler : public Referenced { 29 | public: 30 | virtual ~ErrorHandler(void); 31 | virtual void error(const char* msg, unsigned line, unsigned col); 32 | virtual void fatalError(const char* msg, unsigned line, unsigned col); 33 | virtual void warning(const char* msg, unsigned line, unsigned col); 34 | }; 35 | 36 | } // namespace XML 37 | } // namespace OpenRTI 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketServerTCP.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketServerTCP_h 21 | #define OpenRTI_SocketServerTCP_h 22 | 23 | #include "Export.h" 24 | #include "SocketServer.h" 25 | #include "SocketAddress.h" 26 | #include "SocketTCP.h" 27 | 28 | namespace OpenRTI { 29 | 30 | class OPENRTI_API SocketServerTCP : public SocketServer { 31 | public: 32 | SocketServerTCP(); 33 | 34 | void bind(const SocketAddress& socketAddress); 35 | void listen(int backlog); 36 | 37 | virtual SocketTCP* accept(); 38 | 39 | protected: 40 | virtual ~SocketServerTCP(); 41 | }; 42 | 43 | } // namespace OpenRTI 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketServerPipe.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketServerPipe_h 21 | #define OpenRTI_SocketServerPipe_h 22 | 23 | #include 24 | #include "SocketPipe.h" 25 | #include "SocketServer.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class OPENRTI_API SocketServerPipe : public SocketServer { 30 | public: 31 | SocketServerPipe(); 32 | 33 | void bind(const std::string& file); 34 | void listen(int backlog = 20); 35 | 36 | virtual SocketPipe* accept(); 37 | 38 | virtual void close(); 39 | 40 | protected: 41 | virtual ~SocketServerPipe(); 42 | }; 43 | 44 | 45 | } // namespace OpenRTI 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractMessageSender.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_AbstractMessageSender_h 21 | #define OpenRTI_AbstractMessageSender_h 22 | 23 | #include "Referenced.h" 24 | #include "SharedPtr.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class AbstractMessage; 29 | 30 | class OPENRTI_API AbstractMessageSender : public Referenced { 31 | public: 32 | AbstractMessageSender(); 33 | virtual ~AbstractMessageSender(); 34 | 35 | virtual void send(const SharedPtr& message) = 0; 36 | virtual void close() = 0; 37 | // virtual bool isOpen() const = 0; 38 | }; 39 | 40 | } // namespace OpenRTI 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketTCP.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketTCP_h 21 | #define OpenRTI_SocketTCP_h 22 | 23 | #include "SocketAddress.h" 24 | #include "SocketStream.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class SocketServerTCP; 29 | 30 | class OPENRTI_API SocketTCP : public SocketStream { 31 | public: 32 | SocketTCP(); 33 | 34 | void connect(const SocketAddress& address); 35 | virtual void cork(bool enable); 36 | virtual void shutdown(); 37 | 38 | protected: 39 | SocketTCP(PrivateData* privateData); 40 | virtual ~SocketTCP(); 41 | 42 | friend class SocketServerTCP; 43 | }; 44 | 45 | } // namespace OpenRTI 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketData.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketData_h 21 | #define OpenRTI_SocketData_h 22 | 23 | #include "Socket.h" 24 | 25 | namespace OpenRTI { 26 | 27 | class OPENRTI_API SocketData : public Socket { 28 | public: 29 | 30 | // FIXME need to distinguish between the read side which can have an EOF 31 | // and the write side, which might get an EPIPE if the other endpoint is being closed 32 | // bool isOpen() is the wrong method here. May be isOpenForRead/isOpenForWrite ??? 33 | 34 | protected: 35 | SocketData(PrivateData* privateData); 36 | virtual ~SocketData(); 37 | }; 38 | 39 | } // namespace OpenRTI 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/ErrnoWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "ErrnoWin32.h" 21 | 22 | #ifndef NOMINMAX 23 | # define NOMINMAX 24 | #endif 25 | #include 26 | #include "StringUtils.h" 27 | 28 | namespace OpenRTI { 29 | 30 | std::string errnoToUtf8(int errorNumber) 31 | { 32 | LPWSTR lpMsgBuf; 33 | FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 34 | NULL, errorNumber, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&lpMsgBuf, 0, NULL); 35 | std::wstring s(lpMsgBuf); 36 | LocalFree(lpMsgBuf); 37 | return ucsToUtf8(s); 38 | } 39 | 40 | } // namespace OpenRTI 41 | -------------------------------------------------------------------------------- /tests/rti1516e/fddget/fdd-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ObjectClass1 6 | 7 | Attribute1 8 | 9 | 10 | ObjectClass2 11 | 12 | Attribute2 13 | 14 | 15 | 16 | 17 | ObjectClass3 18 | 19 | Attribute3 20 | 21 | 22 | 23 | 24 | 25 | InteractionClass1 26 | 27 | Parameter1 28 | 29 | 30 | InteractionClass2 31 | 32 | Parameter2 33 | 34 | 35 | 36 | 37 | InteractionClass3 38 | 39 | Parameter3 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /cmake/CreateResource.cmake: -------------------------------------------------------------------------------- 1 | # Creates a c file containing the content of the input 2 | # file in a static variable with the gven name. 3 | function(create_resource _inputFile _variableName _outputFile) 4 | # Work around a bug that hits us with older cmake versions. 5 | # Note the version is just one that is completely known to work. 6 | if(CMAKE_VERSION VERSION_GREATER 2.8.10) 7 | # Read and in HEX form 8 | file(READ ${_inputFile} _filedata HEX) 9 | # Convert hex data to C values 10 | string(REGEX REPLACE "([0-9a-fA-F][0-9a-fA-F])" "char(0x\\1),\n" _filedata ${_filedata}) 11 | # Write to the output file 12 | file(WRITE ${_outputFile} "static const char ${_variableName}[] = {\n${_filedata}};\n") 13 | else() 14 | # Read in string format 15 | file(READ ${_inputFile} _filedata) 16 | # Convert characters to single escaped chars ... puh! 17 | string(REGEX REPLACE "(.)" "'\\1',\n" _filedata ${_filedata}) 18 | string(REPLACE "'\n'" "0x0a" _filedata ${_filedata}) 19 | string(REPLACE "'\r'" "0x0d" _filedata ${_filedata}) 20 | string(REPLACE "'\t'" "' '" _filedata ${_filedata}) 21 | string(REPLACE "'\"'" "0x22" _filedata ${_filedata}) 22 | string(REPLACE "'\\'" "0x5c" _filedata ${_filedata}) 23 | string(REPLACE "'''" "0x27" _filedata ${_filedata}) 24 | # Write to the output file 25 | file(WRITE ${_outputFile} "static const char ${_variableName}[] = {\n${_filedata}};\n") 26 | endif() 27 | endfunction() 28 | 29 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketPacket.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketPacket_h 21 | #define OpenRTI_SocketPacket_h 22 | 23 | #include "Buffer.h" 24 | #include "SocketAddress.h" 25 | #include "SocketData.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class OPENRTI_API SocketPacket : public SocketData { 30 | public: 31 | 32 | ssize_t send(const SocketAddress& socketAddress, const ConstBufferRange& bufferRange); 33 | ssize_t recv(SocketAddress& socketAddress, const BufferRange& bufferRange, bool peek); 34 | 35 | protected: 36 | SocketPacket(PrivateData* privateData); 37 | virtual ~SocketPacket(); 38 | }; 39 | 40 | } // namespace OpenRTI 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/SocketPipeWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketPipe.h" 21 | 22 | #include "SocketPrivateDataWin32.h" 23 | 24 | namespace OpenRTI { 25 | 26 | SocketPipe::SocketPipe() : 27 | SocketStream(new PrivateData) 28 | { 29 | throw RTIinternalError("Pipes are not implemented on WIN32"); 30 | } 31 | 32 | void 33 | SocketPipe::connect(const std::string& file) 34 | { 35 | throw RTIinternalError("Pipes are not implemented on WIN32"); 36 | } 37 | 38 | void 39 | SocketPipe::shutdown() 40 | { 41 | throw RTIinternalError("Pipes are not implemented on WIN32"); 42 | } 43 | 44 | SocketPipe::~SocketPipe() 45 | { 46 | } 47 | 48 | } // namespace OpenRTI 49 | -------------------------------------------------------------------------------- /src/rti1516/VariableLengthDataFriend.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef VariableLengthDataFriend_h 21 | #define VariableLengthDataFriend_h 22 | 23 | #include "VariableLengthData.h" 24 | 25 | namespace rti1516 26 | { 27 | 28 | class RTI_EXPORT VariableLengthDataFriend { 29 | public: 30 | static VariableLengthData 31 | create(const OpenRTI::VariableLengthData& variableLengthData); 32 | static const OpenRTI::VariableLengthData& 33 | readPointer(const rti1516::VariableLengthData& variableLengthData); 34 | static OpenRTI::VariableLengthData& 35 | writePointer(rti1516::VariableLengthData& variableLengthData); 36 | }; 37 | 38 | } 39 | 40 | #endif // VariableLengthDataFriend_h 41 | -------------------------------------------------------------------------------- /src/OpenRTI/posix/ThreadPosix.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "Thread.h" 21 | #include "ThreadPrivateDataPosix.h" 22 | #include "Exception.h" 23 | 24 | namespace OpenRTI { 25 | 26 | Thread::Thread(void) : 27 | _privateData(new PrivateData) 28 | { 29 | } 30 | 31 | Thread::~Thread(void) 32 | { 33 | OpenRTIAssert(!Thread::count(this)); 34 | delete _privateData; 35 | _privateData = 0; 36 | } 37 | 38 | void Thread::destruct(Thread* thread) 39 | { 40 | delete thread; 41 | } 42 | 43 | bool 44 | Thread::start() 45 | { 46 | return _privateData->start(*this); 47 | } 48 | 49 | void 50 | Thread::wait() 51 | { 52 | _privateData->wait(); 53 | } 54 | 55 | } // namespace OpenRTI 56 | -------------------------------------------------------------------------------- /src/rti1516e/VariableLengthDataFriend.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef VariableLengthDataFriend_h 21 | #define VariableLengthDataFriend_h 22 | 23 | #include "VariableLengthData.h" 24 | 25 | namespace rti1516e 26 | { 27 | 28 | class RTI_EXPORT VariableLengthDataFriend { 29 | public: 30 | static VariableLengthData 31 | create(const OpenRTI::VariableLengthData& variableLengthData); 32 | static const OpenRTI::VariableLengthData& 33 | readPointer(const rti1516e::VariableLengthData& variableLengthData); 34 | static OpenRTI::VariableLengthData& 35 | writePointer(rti1516e::VariableLengthData& variableLengthData); 36 | }; 37 | 38 | } 39 | 40 | #endif // VariableLengthDataFriend_h 41 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractMessageReceiver.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_AbstractMessageReceiver_h 21 | #define OpenRTI_AbstractMessageReceiver_h 22 | 23 | #include "Referenced.h" 24 | #include "SharedPtr.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class AbstractMessage; 29 | class Clock; 30 | 31 | class OPENRTI_API AbstractMessageReceiver : public Referenced { 32 | public: 33 | virtual ~AbstractMessageReceiver() {} 34 | virtual SharedPtr receive() = 0; 35 | virtual SharedPtr receive(const Clock& timeout) = 0; 36 | virtual bool empty() const = 0; 37 | virtual bool isOpen() const = 0; 38 | }; 39 | 40 | } // namespace OpenRTI 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/OpenRTI/posix/DynamicModulePosix.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2013-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "OpenRTIConfig.h" 21 | 22 | #include "DynamicModule.h" 23 | 24 | #include "StringUtils.h" 25 | #include "Types.h" 26 | 27 | #ifndef _GNU_SOURCE 28 | # define _GNU_SOURCE 29 | #endif 30 | #include 31 | 32 | namespace OpenRTI { 33 | 34 | std::string 35 | DynamicModule::getFileNameForAddress(const void* address) 36 | { 37 | #if defined OpenRTI_HAVE_DLADDR 38 | Dl_info info; 39 | if (0 == dladdr((void*)address, &info)) 40 | return std::string(); 41 | if (!info.dli_fname) 42 | return std::string(); 43 | return localeToUtf8(info.dli_fname); 44 | #else 45 | return std::string(); 46 | #endif 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/SocketWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "Socket.h" 21 | 22 | #include "SocketPrivateDataWin32.h" 23 | 24 | namespace OpenRTI { 25 | 26 | void 27 | Socket::destruct(Socket* socket) 28 | { 29 | delete socket; 30 | } 31 | 32 | bool 33 | Socket::isOpen() const 34 | { 35 | if (!_privateData) 36 | return false; 37 | return SOCKET_ERROR != _privateData->_socket; 38 | } 39 | 40 | void 41 | Socket::close() 42 | { 43 | _privateData->close(); 44 | } 45 | 46 | Socket::Socket(PrivateData* privateData) : 47 | _privateData(privateData) 48 | { 49 | } 50 | 51 | Socket::~Socket() 52 | { 53 | delete _privateData; 54 | _privateData = 0; 55 | } 56 | 57 | } // namespace OpenRTI 58 | -------------------------------------------------------------------------------- /src/OpenRTI/Thread.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_Thread_h 21 | #define OpenRTI_Thread_h 22 | 23 | #include "Export.h" 24 | #include "SharedPtr.h" 25 | #include "WeakReferenced.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class OPENRTI_API Thread : public WeakReferenced { 30 | public: 31 | Thread(void); 32 | 33 | static void destruct(Thread* thread); 34 | 35 | bool start(); 36 | void wait(); 37 | 38 | protected: 39 | virtual ~Thread(void); 40 | 41 | virtual void run() = 0; 42 | 43 | private: 44 | Thread(const Thread&); 45 | Thread& operator=(const Thread&); 46 | 47 | struct PrivateData; 48 | PrivateData* _privateData; 49 | }; 50 | 51 | } // namespace OpenRTI 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/rti1516/RTI/HLAfloat64TimeFactory.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef RTI_HLAfloat64TimeFactory_h 21 | #define RTI_HLAfloat64TimeFactory_h 22 | 23 | #include "LogicalTimeFactory.h" 24 | 25 | class HLAfloat64Interval; 26 | class HLAfloat64Time; 27 | 28 | class RTI_EXPORT_FEDTIME HLAfloat64TimeFactory : public rti1516::LogicalTimeFactory { 29 | public: 30 | HLAfloat64TimeFactory(); 31 | virtual ~HLAfloat64TimeFactory() 32 | RTI_NOEXCEPT; 33 | virtual RTI_UNIQUE_PTR makeLogicalTime() 34 | RTI_THROW ((rti1516::InternalError)); 35 | virtual RTI_UNIQUE_PTR makeLogicalTimeInterval() 36 | RTI_THROW ((rti1516::InternalError)); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractSocketEvent.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "AbstractSocketEvent.h" 21 | 22 | namespace OpenRTI { 23 | 24 | AbstractSocketEvent::AbstractSocketEvent() : 25 | _socketEventDispatcher(0), 26 | _timeout(Clock::max()) 27 | { 28 | } 29 | 30 | AbstractSocketEvent::~AbstractSocketEvent() 31 | { 32 | } 33 | 34 | void 35 | AbstractSocketEvent::read(SocketEventDispatcher& dispatcher) 36 | { 37 | } 38 | 39 | void 40 | AbstractSocketEvent::write(SocketEventDispatcher& dispatcher) 41 | { 42 | } 43 | 44 | void 45 | AbstractSocketEvent::timeout(SocketEventDispatcher& dispatcher) 46 | { 47 | } 48 | 49 | void 50 | AbstractSocketEvent::error(const Exception& e) 51 | { 52 | } 53 | 54 | } // namespace OpenRTI 55 | -------------------------------------------------------------------------------- /include/rti1516/RTI/HLAinteger64TimeFactory.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef RTI_HLAinteger64TimeFactory_h 21 | #define RTI_HLAinteger64TimeFactory_h 22 | 23 | #include "LogicalTimeFactory.h" 24 | 25 | class HLAinteger64Interval; 26 | class HLAinteger64Time; 27 | 28 | class RTI_EXPORT_FEDTIME HLAinteger64TimeFactory : public rti1516::LogicalTimeFactory { 29 | public: 30 | HLAinteger64TimeFactory(); 31 | virtual ~HLAinteger64TimeFactory() 32 | RTI_NOEXCEPT; 33 | virtual RTI_UNIQUE_PTR makeLogicalTime() 34 | RTI_THROW ((rti1516::InternalError)); 35 | virtual RTI_UNIQUE_PTR makeLogicalTimeInterval() 36 | RTI_THROW ((rti1516::InternalError)); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/OpenRTI/InitialServerStreamProtocol.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_InitialServerStreamProtocol_h 21 | #define OpenRTI_InitialServerStreamProtocol_h 22 | 23 | #include "InitialStreamProtocol.h" 24 | 25 | namespace OpenRTI { 26 | 27 | class AbstractServer; 28 | 29 | class OPENRTI_API InitialServerStreamProtocol : public InitialStreamProtocol { 30 | public: 31 | InitialServerStreamProtocol(AbstractServer& abstractServer); 32 | virtual ~InitialServerStreamProtocol(); 33 | 34 | virtual void readOptionMap(const StringStringListMap& clientOptionMap); 35 | void errorResponse(const std::string& errorMessage); 36 | 37 | private: 38 | AbstractServer& _abstractServer; 39 | }; 40 | 41 | } // namespace OpenRTI 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/rti1516e/RTI/encoding/EncodingExceptions.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | The IEEE hereby grants a general, royalty-free license to copy, distribute, 3 | display and make derivative works from this material, for all purposes, 4 | provided that any use of the material contains the following 5 | attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010". 6 | Should you require additional information, contact the Manager, Standards 7 | Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org). 8 | ***********************************************************************/ 9 | /*********************************************************************** 10 | IEEE 1516.1 High Level Architecture Interface Specification C++ API 11 | File: EncodingExceptions.h 12 | ***********************************************************************/ 13 | #ifndef RTI_EncodingExcpetions_H_ 14 | #define RTI_EncodingExcpetions_H_ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | namespace rti1516e 21 | { 22 | 23 | class RTI_EXPORT EncoderException: public Exception 24 | { 25 | public: 26 | EncoderException (std::wstring const & message) 27 | RTI_NOEXCEPT; 28 | 29 | std::wstring what () const 30 | RTI_NOEXCEPT; 31 | 32 | private: 33 | std::wstring _msg; 34 | }; 35 | } 36 | 37 | 38 | #endif // RTI_EncodingExcpetions_H_ 39 | 40 | -------------------------------------------------------------------------------- /src/OpenRTI/DefaultErrorHandler.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_DefaultErrorHandler_h 21 | #define OpenRTI_DefaultErrorHandler_h 22 | 23 | #include 24 | 25 | #include "ErrorHandler.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class OPENRTI_LOCAL DefaultErrorHandler : public XML::ErrorHandler { 30 | public: 31 | DefaultErrorHandler(); 32 | virtual ~DefaultErrorHandler(); 33 | 34 | virtual void error(const char* msg, unsigned line, unsigned col); 35 | virtual void fatalError(const char* msg, unsigned line, unsigned col); 36 | virtual void warning(const char* msg, unsigned line, unsigned col); 37 | 38 | std::string getMessages() const; 39 | 40 | private: 41 | std::stringstream _stream; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/OpenRTI/xml/macconfig.h: -------------------------------------------------------------------------------- 1 | /*================================================================ 2 | ** Copyright 2000, Clark Cooper 3 | ** All rights reserved. 4 | ** 5 | ** This is free software. You are permitted to copy, distribute, or modify 6 | ** it under the terms of the MIT/X license (contained in the COPYING file 7 | ** with this distribution.) 8 | ** 9 | */ 10 | 11 | #ifndef MACCONFIG_H 12 | #define MACCONFIG_H 13 | 14 | 15 | /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ 16 | #define BYTEORDER 4321 17 | 18 | /* Define to 1 if you have the `bcopy' function. */ 19 | #undef HAVE_BCOPY 20 | 21 | /* Define to 1 if you have the `memmove' function. */ 22 | #define HAVE_MEMMOVE 23 | 24 | /* Define to 1 if you have a working `mmap' system call. */ 25 | #undef HAVE_MMAP 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_UNISTD_H 29 | 30 | /* whether byteorder is bigendian */ 31 | #define WORDS_BIGENDIAN 32 | 33 | /* Define to specify how much context to retain around the current parse 34 | point. */ 35 | #undef XML_CONTEXT_BYTES 36 | 37 | /* Define to make parameter entity parsing functionality available. */ 38 | #define XML_DTD 39 | 40 | /* Define to make XML Namespaces functionality available. */ 41 | #define XML_NS 42 | 43 | /* Define to empty if `const' does not conform to ANSI C. */ 44 | #undef const 45 | 46 | /* Define to `long' if does not define. */ 47 | #define off_t long 48 | 49 | /* Define to `unsigned' if does not define. */ 50 | #undef size_t 51 | 52 | 53 | #endif /* ifndef MACCONFIG_H */ 54 | -------------------------------------------------------------------------------- /src/rti1516e/DataElement.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2011-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace rti1516e 25 | { 26 | 27 | DataElement::~DataElement() 28 | { 29 | } 30 | 31 | bool 32 | DataElement::isSameTypeAs(DataElement const& inData) const 33 | { 34 | return typeid(*this) == typeid(inData); 35 | } 36 | 37 | Integer64 38 | DataElement::hash() const 39 | { 40 | try { 41 | std::vector buffer; 42 | encodeInto(buffer); 43 | Integer64 hash = 8191; 44 | for (std::vector::const_iterator i = buffer.begin(); i != buffer.end(); ++i) 45 | hash = hash*Integer64(127) + Integer64(*i); 46 | return hash; 47 | } catch (const EncoderException&) { 48 | return -1; 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/SocketPacketWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketPacket.h" 21 | #include "ErrnoWin32.h" 22 | #include "SocketPrivateDataWin32.h" 23 | 24 | namespace OpenRTI { 25 | 26 | ssize_t 27 | SocketPacket::send(const SocketAddress& socketAddress, const ConstBufferRange& bufferRange) 28 | { 29 | throw RTIinternalError("No packet sockets on win32 so far!"); 30 | } 31 | 32 | ssize_t 33 | SocketPacket::recv(SocketAddress& socketAddress, const BufferRange& bufferRange, bool peek) 34 | { 35 | throw RTIinternalError("No packet sockets on win32 so far!"); 36 | } 37 | 38 | SocketPacket::SocketPacket(PrivateData* privateData) : 39 | SocketData(privateData) 40 | { 41 | } 42 | 43 | SocketPacket::~SocketPacket() 44 | { 45 | } 46 | 47 | } // namespace OpenRTI 48 | -------------------------------------------------------------------------------- /src/OpenRTI/DynamicModule.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2013-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_DynamicModule_h 21 | #define OpenRTI_DynamicModule_h 22 | 23 | #include 24 | #include "Export.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class OPENRTI_API DynamicModule { 29 | public: 30 | 31 | /// Returns the file name of the code object that contains the given address. 32 | /// If the system does not support this functionality or some error occurs the 33 | /// returned file name is empty. 34 | static std::string getFileNameForAddress(const void* address); 35 | 36 | private: 37 | DynamicModule(const DynamicModule&); 38 | DynamicModule& operator=(const DynamicModule&); 39 | 40 | // struct PrivateData; 41 | // PrivateData* _privateData; 42 | }; 43 | 44 | } // namespace OpenRTI 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/AtomicWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "Atomic.h" 21 | 22 | #if defined OpenRTI_ATOMIC_USE_LIBRARY 23 | #ifndef NOMINMAX 24 | # define NOMINMAX 25 | #endif 26 | #include 27 | 28 | namespace OpenRTI { 29 | 30 | unsigned 31 | Atomic::inc() 32 | { 33 | return InterlockedIncrement(&_value); 34 | } 35 | 36 | unsigned 37 | Atomic::dec() 38 | { 39 | return InterlockedDecrement(&_value); 40 | } 41 | 42 | unsigned 43 | Atomic::get() const 44 | { 45 | #ifdef __MINGW32__ 46 | __sync_synchronize(); 47 | #else 48 | MemoryBarrier(); 49 | #endif 50 | return _value; 51 | } 52 | 53 | bool 54 | Atomic::cmpxch(unsigned oldValue, unsigned newValue) 55 | { 56 | return oldValue == InterlockedCompareExchange(&_value, newValue, oldValue); 57 | } 58 | 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /tests/rti1516/join/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(join-1516 join.cpp) 2 | target_link_libraries(join-1516 rti1516 fedtime1516 OpenRTI) 3 | 4 | # No server - thread protocol, one ambassador 5 | add_test(rti1516/join-1516-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/join-1516" -S0 -A1 -O "${RTI1516_FDD_FILE}") 6 | # No server - thread protocol, 10 ambassadors 7 | add_test(rti1516/join-1516-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/join-1516" -S0 -A10 -O "${RTI1516_FDD_FILE}") 8 | # 1 server - rti protocol, one ambassador 9 | add_test(rti1516/join-1516-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/join-1516" -S1 -A1 -O "${RTI1516_FDD_FILE}") 10 | # 1 server - rti protocol, 10 ambassadors 11 | add_test(rti1516/join-1516-4 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/join-1516" -S1 -A10 -O "${RTI1516_FDD_FILE}") 12 | # 5 servers - rti protocol, 10 ambassadors 13 | add_test(rti1516/join-1516-5 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/join-1516" -S5 -A10 -O "${RTI1516_FDD_FILE}") 14 | 15 | add_executable(concurrent-join-1516 concurrent-join.cpp) 16 | target_link_libraries(concurrent-join-1516 rti1516 fedtime1516 OpenRTI) 17 | 18 | # No server - thread protocol, one ambassador 19 | add_test(rti1516/concurrent-join-1516-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/concurrent-join-1516" -S0 -A10 -O "${RTI1516_FDD_FILE}") 20 | # 1 server - rti protocol, 10 ambassadors 21 | add_test(rti1516/concurrent-join-1516-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/concurrent-join-1516" -S1 -A10 -O "${RTI1516_FDD_FILE}") 22 | # 5 servers - rti protocol, 10 ambassadors 23 | add_test(rti1516/concurrent-join-1516-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/concurrent-join-1516" -S5 -A10 -O "${RTI1516_FDD_FILE}") 24 | -------------------------------------------------------------------------------- /src/rti1516/RTIambassadorFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | #include "RTIambassadorImplementation.h" 26 | 27 | #include 28 | 29 | namespace rti1516 30 | { 31 | 32 | RTIambassadorFactory::RTIambassadorFactory() 33 | { 34 | } 35 | 36 | RTIambassadorFactory::~RTIambassadorFactory() 37 | RTI_NOEXCEPT 38 | { 39 | } 40 | 41 | RTI_UNIQUE_PTR 42 | RTIambassadorFactory::createRTIambassador(std::vector& args) 43 | RTI_THROW ((BadInitializationParameter, 44 | RTIinternalError)) 45 | { 46 | return RTI_UNIQUE_PTR(new OpenRTI::RTIambassadorImplementation(args)); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/OpenRTI/XMLReader.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "XMLReader.h" 21 | 22 | namespace OpenRTI { 23 | namespace XML { 24 | 25 | XMLReader::~XMLReader(void) 26 | { 27 | } 28 | 29 | ContentHandler* 30 | XMLReader::getContentHandler(void) const 31 | { 32 | const ContentHandler* ch = mContentHandler.get(); 33 | return const_cast(ch); 34 | } 35 | 36 | void 37 | XMLReader::setContentHandler(ContentHandler* contentHandler) 38 | { 39 | mContentHandler = contentHandler; 40 | } 41 | 42 | ErrorHandler* 43 | XMLReader::getErrorHandler(void) const 44 | { 45 | const ErrorHandler* eh = mErrorHandler.get(); 46 | return const_cast(eh); 47 | } 48 | 49 | void 50 | XMLReader::setErrorHandler(ErrorHandler* errorHandler) 51 | { 52 | mErrorHandler = errorHandler; 53 | } 54 | 55 | } // namespace XML 56 | } // namespace OpenRTI 57 | -------------------------------------------------------------------------------- /tests/rti1516/create/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(create-1516 create.cpp) 2 | target_link_libraries(create-1516 rti1516 fedtime1516 OpenRTI) 3 | 4 | # No server - thread protocol, one ambassador 5 | add_test(rti1516/create-1516-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/create-1516" -S0 -A1 -O "${RTI1516_FDD_FILE}") 6 | # No server - thread protocol, 10 ambassadors 7 | add_test(rti1516/create-1516-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/create-1516" -S0 -A10 -O "${RTI1516_FDD_FILE}") 8 | # 1 server - rti protocol, one ambassador 9 | add_test(rti1516/create-1516-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/create-1516" -S1 -A1 -O "${RTI1516_FDD_FILE}") 10 | # 1 server - rti protocol, 10 ambassadors 11 | add_test(rti1516/create-1516-4 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/create-1516" -S1 -A10 -O "${RTI1516_FDD_FILE}") 12 | # 5 servers - rti protocol, 10 ambassadors 13 | add_test(rti1516/create-1516-5 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/create-1516" -S5 -A10 -O "${RTI1516_FDD_FILE}") 14 | 15 | add_executable(concurrent-create-1516 concurrent-create.cpp) 16 | target_link_libraries(concurrent-create-1516 rti1516 fedtime1516 OpenRTI) 17 | 18 | # No server - thread protocol, one ambassador 19 | add_test(rti1516/concurrent-create-1516-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/concurrent-create-1516" -S0 -A10 -O "${RTI1516_FDD_FILE}") 20 | # 1 server - rti protocol, 10 ambassadors 21 | add_test(rti1516/concurrent-create-1516-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/concurrent-create-1516" -S1 -A10 -O "${RTI1516_FDD_FILE}") 22 | # 5 servers - rti protocol, 10 ambassadors 23 | add_test(rti1516/concurrent-create-1516-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/concurrent-create-1516" -S5 -A10 -O "${RTI1516_FDD_FILE}") 24 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/SocketServerWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketServer.h" 21 | 22 | #include "ErrnoWin32.h" 23 | #include "SocketAddressPrivateDataWin32.h" 24 | #include "SocketPrivateDataWin32.h" 25 | 26 | namespace OpenRTI { 27 | 28 | SocketAddress 29 | SocketServer::getsockname() const 30 | { 31 | struct sockaddr_storage sockaddr; 32 | socklen_t addrlen = sizeof(sockaddr); 33 | int ret = ::getsockname(_privateData->_socket, (struct sockaddr*)&sockaddr, &addrlen); 34 | if (ret == -1) 35 | throw TransportError(errnoToUtf8(WSAGetLastError())); 36 | 37 | return SocketAddress(new SocketAddress::PrivateData((struct sockaddr*)&sockaddr, addrlen)); 38 | } 39 | 40 | SocketServer::SocketServer(PrivateData* privateData) : 41 | Socket(privateData) 42 | { 43 | } 44 | 45 | SocketServer::~SocketServer() 46 | { 47 | } 48 | 49 | } // namespace OpenRTI 50 | -------------------------------------------------------------------------------- /include/rti1516e/RTI/RTIambassadorFactory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | The IEEE hereby grants a general, royalty-free license to copy, distribute, 3 | display and make derivative works from this material, for all purposes, 4 | provided that any use of the material contains the following 5 | attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010". 6 | Should you require additional information, contact the Manager, Standards 7 | Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org). 8 | ***********************************************************************/ 9 | /*********************************************************************** 10 | IEEE 1516.1 High Level Architecture Interface Specification C++ API 11 | File: RTI/RTIambassadorFactory.h 12 | ***********************************************************************/ 13 | 14 | #ifndef RTI_RTIambassadorFactory_h 15 | #define RTI_RTIambassadorFactory_h 16 | 17 | namespace rti1516e 18 | { 19 | class RTIambassador; 20 | } 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace rti1516e 29 | { 30 | class RTI_EXPORT RTIambassadorFactory 31 | { 32 | public: 33 | RTIambassadorFactory(); 34 | 35 | virtual ~RTIambassadorFactory() 36 | RTI_NOEXCEPT; 37 | 38 | // 10.35 39 | RTI_UNIQUE_PTR< RTIambassador > createRTIambassador () 40 | RTI_THROW (( 41 | RTIinternalError)); 42 | }; 43 | } 44 | 45 | #endif // RTI_RTIambassadorFactory_h 46 | -------------------------------------------------------------------------------- /src/rti1516e/HLAlogicalTimeFactoryFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace rti1516e { 28 | 29 | RTI_UNIQUE_PTR 30 | HLAlogicalTimeFactoryFactory::makeLogicalTimeFactory(const std::wstring& implementationName) 31 | { 32 | if (implementationName.empty()) 33 | return RTI_UNIQUE_PTR(new HLAfloat64TimeFactory); 34 | else if (implementationName == L"HLAfloat64Time") 35 | return RTI_UNIQUE_PTR(new HLAfloat64TimeFactory); 36 | else if (implementationName == L"HLAinteger64Time") 37 | return RTI_UNIQUE_PTR(new HLAinteger64TimeFactory); 38 | else 39 | return RTI_UNIQUE_PTR(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/MutexPrivateDataWin32.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef MutexPrivateDataWin32_h 21 | #define MutexPrivateDataWin32_h 22 | 23 | #include "Mutex.h" 24 | #ifndef NOMINMAX 25 | # define NOMINMAX 26 | #endif 27 | #include 28 | 29 | namespace OpenRTI { 30 | 31 | #if __cplusplus < 201103L 32 | struct Mutex::PrivateData { 33 | PrivateData() 34 | { 35 | InitializeCriticalSection((LPCRITICAL_SECTION)&_criticalSection); 36 | } 37 | 38 | ~PrivateData() 39 | { 40 | DeleteCriticalSection((LPCRITICAL_SECTION)&_criticalSection); 41 | } 42 | 43 | void lock(void) 44 | { 45 | EnterCriticalSection((LPCRITICAL_SECTION)&_criticalSection); 46 | } 47 | 48 | void unlock(void) 49 | { 50 | LeaveCriticalSection((LPCRITICAL_SECTION)&_criticalSection); 51 | } 52 | 53 | CRITICAL_SECTION _criticalSection; 54 | }; 55 | #endif 56 | 57 | } // namespace OpenRTI 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /cmake/PkgConfig.cmake: -------------------------------------------------------------------------------- 1 | function(create_pkg_config _TARGET _DESCRIPTION _INCLUDESUBDIR _LIBSUBDIR) 2 | set(TARGET_NAME ${_TARGET}) 3 | set(PKGCONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.pc") 4 | 5 | get_property(LIBRARY_NAME TARGET ${_TARGET} PROPERTY LIBRARY_OUTPUT_NAME) 6 | if(NOT LIBRARY_NAME) 7 | set(LIBRARY_NAME ${TARGET_NAME}) 8 | endif() 9 | 10 | set(RPATH_LINK) 11 | if(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) 12 | set(RPATH_LINK "${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG}\${libdir}") 13 | endif() 14 | 15 | file(WRITE ${PKGCONFIG_FILE} 16 | "prefix=${CMAKE_INSTALL_PREFIX}\n" 17 | "exec_prefix=\${prefix}\n" 18 | "libdir=\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}/${_LIBSUBDIR}\n" 19 | "includedir=\${prefix}/include/${_INCLUDESUBDIR}\n" 20 | "Name: ${TARGET_NAME}\n" 21 | "Description: ${_DESCRIPTION}\n" 22 | "Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\n" 23 | "Libs: -L\${libdir} ${RPATH_LINK} -l${LIBRARY_NAME}\n" 24 | "Cflags: -I\${includedir}\n" 25 | ) 26 | install(FILES ${PKGCONFIG_FILE} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) 27 | endfunction() 28 | 29 | function(create_api_pkg_config _NAME _DESCRIPTION) 30 | set(PKGCONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/${_NAME}.pc") 31 | string(REPLACE ";" " " _REQUIRES "${ARGN}") 32 | file(WRITE ${PKGCONFIG_FILE} 33 | "Name: ${_NAME}\n" 34 | "Description: ${_DESCRIPTION}\n" 35 | "Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\n" 36 | "Requires: ${_REQUIRES}\n" 37 | ) 38 | install(FILES ${PKGCONFIG_FILE} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) 39 | endfunction() 40 | -------------------------------------------------------------------------------- /src/OpenRTI/ThreadServer.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_ThreadServer_h 21 | #define OpenRTI_ThreadServer_h 22 | 23 | #include "AbstractServer.h" 24 | #include "Condition.h" 25 | #include "Mutex.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class OPENRTI_API ThreadServer : public AbstractServer { 30 | public: 31 | ThreadServer(const SharedPtr& serverNode); 32 | virtual ~ThreadServer(); 33 | 34 | virtual int exec(); 35 | 36 | protected: 37 | virtual void _postMessage(const _MessageConnectHandlePair& messageConnectHandlePair); 38 | virtual void _postOperation(const SharedPtr<_Operation>& operation); 39 | 40 | private: 41 | ThreadServer(const ThreadServer&); 42 | ThreadServer& operator=(const ThreadServer&); 43 | 44 | mutable Mutex _mutex; 45 | Condition _condition; 46 | _Queue _queue; 47 | _MessageConnectHandlePairList _pool; 48 | }; 49 | 50 | } // namespace OpenRTI 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/OpenRTI/DefaultErrorHandler.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "DefaultErrorHandler.h" 21 | 22 | namespace OpenRTI { 23 | 24 | DefaultErrorHandler::DefaultErrorHandler() 25 | { 26 | } 27 | 28 | DefaultErrorHandler::~DefaultErrorHandler() 29 | { 30 | } 31 | 32 | void 33 | DefaultErrorHandler::error(const char* msg, unsigned line, unsigned col) 34 | { 35 | _stream << "error: at line " << line << " in column " << col << ": \"" << msg << "\"" << std::endl; 36 | } 37 | 38 | void 39 | DefaultErrorHandler::fatalError(const char* msg, unsigned line, unsigned col) 40 | { 41 | _stream << "fatalError: at line " << line << " in column " << col << ": \"" << msg << "\"" << std::endl; 42 | } 43 | 44 | void 45 | DefaultErrorHandler::warning(const char* msg, unsigned line, unsigned col) 46 | { 47 | } 48 | 49 | std::string 50 | DefaultErrorHandler::getMessages() const 51 | { 52 | return _stream.str(); 53 | } 54 | 55 | } // namespace OpenRTI 56 | -------------------------------------------------------------------------------- /src/OpenRTI/Socket.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_Socket_h 21 | #define OpenRTI_Socket_h 22 | 23 | #include "Export.h" 24 | #include "Referenced.h" 25 | 26 | namespace OpenRTI { 27 | 28 | class SocketEventDispatcher; 29 | 30 | class OPENRTI_API Socket : public Referenced { 31 | public: 32 | static void destruct(Socket* socket); 33 | 34 | bool isOpen() const; 35 | virtual void close(); 36 | 37 | // Sigh, a strange access problem on aCC and early gcc, just disable that control here 38 | #if !defined(__hpux) && !(defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 1))) 39 | protected: 40 | #endif 41 | struct PrivateData; 42 | PrivateData* _privateData; 43 | 44 | Socket(PrivateData* privateData); 45 | virtual ~Socket(); 46 | 47 | private: 48 | Socket(const Socket &sock); 49 | void operator=(const Socket &sock); 50 | 51 | friend class SocketEventDispatcher; 52 | }; 53 | 54 | } // namespace OpenRTI 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/OpenRTI/ZLibProtocolLayer.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_ZLibProtocolLayer_h 21 | #define OpenRTI_ZLibProtocolLayer_h 22 | 23 | #include "NestedProtocolLayer.h" 24 | 25 | namespace OpenRTI { 26 | 27 | #ifdef OPENRTI_HAVE_ZLIB 28 | class OPENRTI_API ZLibProtocolLayer : public NestedProtocolLayer { 29 | public: 30 | ZLibProtocolLayer(); 31 | virtual ~ZLibProtocolLayer(); 32 | 33 | // Is called from the parent protocol layer when there is data to read 34 | virtual void read(AbstractProtocolSocket& protocolSocket); 35 | virtual bool getEnableRead() const; 36 | // Is called from the parent protocol layer when there is space to write something 37 | virtual void write(AbstractProtocolSocket& protocolSocket); 38 | virtual bool getEnableWrite() const; 39 | 40 | virtual void error(const Exception& e); 41 | 42 | private: 43 | class ProtocolSocket; 44 | ProtocolSocket* _protocolSocket; 45 | }; 46 | #endif 47 | 48 | } // namespace OpenRTI 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/OpenRTI/win32/SocketServerPipeWin32.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "SocketServerPipe.h" 21 | 22 | #include "SocketPrivateDataWin32.h" 23 | 24 | namespace OpenRTI { 25 | 26 | SocketServerPipe::SocketServerPipe() : 27 | SocketServer(new PrivateData) 28 | { 29 | throw RTIinternalError("Pipes are not implemented on WIN32"); 30 | } 31 | 32 | void 33 | SocketServerPipe::bind(const std::string& file) 34 | { 35 | throw RTIinternalError("Pipes are not implemented on WIN32"); 36 | } 37 | 38 | void 39 | SocketServerPipe::listen(int backlog) 40 | { 41 | throw RTIinternalError("Pipes are not implemented on WIN32"); 42 | } 43 | 44 | SocketPipe* 45 | SocketServerPipe::accept() 46 | { 47 | throw RTIinternalError("Pipes are not implemented on WIN32"); 48 | } 49 | 50 | void 51 | SocketServerPipe::close() 52 | { 53 | throw RTIinternalError("Pipes are not implemented on WIN32"); 54 | } 55 | 56 | SocketServerPipe::~SocketServerPipe() 57 | { 58 | } 59 | 60 | } // namespace OpenRTI 61 | -------------------------------------------------------------------------------- /src/OpenRTI/XMLReader.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_XML_XMLReader_h 21 | #define OpenRTI_XML_XMLReader_h 22 | 23 | #include 24 | #include 25 | 26 | #include "Referenced.h" 27 | #include "SharedPtr.h" 28 | 29 | #include "Attributes.h" 30 | #include "ContentHandler.h" 31 | #include "ErrorHandler.h" 32 | 33 | namespace OpenRTI { 34 | namespace XML { 35 | 36 | class OPENRTI_API XMLReader : public Referenced { 37 | public: 38 | virtual ~XMLReader(void); 39 | virtual void parse(std::istream& stream, const std::string& encoding) = 0; 40 | 41 | ContentHandler* getContentHandler(void) const; 42 | void setContentHandler(ContentHandler* contentHandler); 43 | 44 | ErrorHandler* getErrorHandler(void) const; 45 | void setErrorHandler(ErrorHandler* errorHandler); 46 | 47 | protected: 48 | SharedPtr mContentHandler; 49 | SharedPtr mErrorHandler; 50 | }; 51 | 52 | } // namespace XML 53 | } // namespace OpenRTI 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/OpenRTI/ScopeLock.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_ScopeLock_h 21 | #define OpenRTI_ScopeLock_h 22 | 23 | #include "Mutex.h" 24 | 25 | namespace OpenRTI { 26 | 27 | #if 201103L <= __cplusplus 28 | 29 | class ScopeLock : public std::unique_lock { 30 | public: 31 | ScopeLock(Mutex& mutex) : std::unique_lock(mutex._mutex) 32 | { } 33 | ~ScopeLock(void) 34 | { } 35 | 36 | private: 37 | ScopeLock(void); 38 | ScopeLock(const ScopeLock&); 39 | ScopeLock& operator=(const ScopeLock&); 40 | }; 41 | 42 | #else 43 | 44 | class ScopeLock { 45 | public: 46 | ScopeLock(Mutex& mutex) : mMutex(mutex) 47 | { mMutex.lock(); } 48 | ~ScopeLock(void) 49 | { mMutex.unlock(); } 50 | 51 | Mutex* mutex() const 52 | { return &mMutex; } 53 | 54 | private: 55 | ScopeLock(void); 56 | ScopeLock(const ScopeLock&); 57 | ScopeLock& operator=(const ScopeLock&); 58 | 59 | Mutex& mMutex; 60 | }; 61 | 62 | #endif 63 | 64 | } // namespace OpenRTI 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /tests/rti1516e/fddget/fdd-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HLAobjectRoot 6 | 7 | HLAprivilegeToDeleteObject 8 | 9 | 10 | ObjectClass1 11 | 12 | Attribute1 13 | 14 | 15 | ObjectClass2 16 | 17 | Attribute2 18 | 19 | 20 | 21 | 22 | ObjectClass3 23 | 24 | Attribute3 25 | 26 | 27 | 28 | 29 | 30 | 31 | HLAinteractionRoot 32 | 33 | InteractionClass1 34 | 35 | Parameter1 36 | 37 | 38 | InteractionClass2 39 | 40 | Parameter2 41 | 42 | 43 | 44 | 45 | InteractionClass3 46 | 47 | Parameter3 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/OpenRTI/ContentHandler.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "ContentHandler.h" 21 | 22 | namespace OpenRTI { 23 | namespace XML { 24 | 25 | ContentHandler::~ContentHandler(void) 26 | { 27 | } 28 | 29 | void 30 | ContentHandler::characters(const char* data, unsigned length) 31 | { 32 | } 33 | 34 | void 35 | ContentHandler::comment(const char* commentData, unsigned length) 36 | { 37 | } 38 | 39 | void 40 | ContentHandler::startDocument(void) 41 | { 42 | } 43 | 44 | void 45 | ContentHandler::endDocument(void) 46 | { 47 | } 48 | 49 | void 50 | ContentHandler::startElement(const char*, const char*, const char*, 51 | const Attributes*) 52 | { 53 | } 54 | 55 | void 56 | ContentHandler::endElement(const char*, const char*, const char*) 57 | { 58 | } 59 | 60 | void 61 | ContentHandler::skippedEntity(const char* name) 62 | { 63 | } 64 | 65 | void 66 | ContentHandler::processingInstruction(const char*, const char*) 67 | { 68 | } 69 | 70 | } // namespace XML 71 | } // namespace OpenRTI 72 | -------------------------------------------------------------------------------- /src/rti1516/HLAfloat64TimeFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | HLAfloat64TimeFactory::HLAfloat64TimeFactory() 32 | { 33 | } 34 | 35 | HLAfloat64TimeFactory::~HLAfloat64TimeFactory() 36 | RTI_NOEXCEPT 37 | { 38 | } 39 | 40 | RTI_UNIQUE_PTR 41 | HLAfloat64TimeFactory::makeLogicalTime() 42 | RTI_THROW ((rti1516::InternalError)) 43 | { 44 | return RTI_UNIQUE_PTR(new HLAfloat64Time); 45 | } 46 | 47 | RTI_UNIQUE_PTR 48 | HLAfloat64TimeFactory::makeLogicalTimeInterval() 49 | RTI_THROW ((rti1516::InternalError)) 50 | { 51 | return RTI_UNIQUE_PTR(new HLAfloat64Interval); 52 | } 53 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketServerAcceptEvent.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketServerAcceptEvent_h 21 | #define OpenRTI_SocketServerAcceptEvent_h 22 | 23 | #include "AbstractSocketEvent.h" 24 | #include "SharedPtr.h" 25 | #include "SocketServer.h" 26 | 27 | namespace OpenRTI { 28 | 29 | class AbstractServer; 30 | 31 | class OPENRTI_API SocketServerAcceptEvent : public AbstractSocketEvent { 32 | public: 33 | SocketServerAcceptEvent(const SharedPtr& socketServer, 34 | AbstractServer& abstractServer); 35 | virtual ~SocketServerAcceptEvent(); 36 | 37 | virtual void read(SocketEventDispatcher& dispatcher); 38 | virtual bool getEnableRead() const; 39 | 40 | virtual void write(SocketEventDispatcher& dispatcher); 41 | virtual bool getEnableWrite() const; 42 | 43 | virtual SocketServer* getSocket() const; 44 | 45 | private: 46 | SharedPtr _socketServer; 47 | AbstractServer& _abstractServer; 48 | }; 49 | 50 | } // namespace OpenRTI 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/OpenRTI/SocketUDP.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_SocketUDP_h 21 | #define OpenRTI_SocketUDP_h 22 | 23 | #include "SocketPacket.h" 24 | 25 | namespace OpenRTI { 26 | 27 | class SocketUDP : public SocketPacket { 28 | public: 29 | SocketUDP(); 30 | // SocketUDP(unsigned short localPort); 31 | // SocketUDP(const std::string &localAddress, unsigned short localPort); 32 | // void disconnect(); 33 | // void sendTo(const void *buffer, int bufferLen, const std::string &foreignAddress, 34 | // unsigned short foreignPort); 35 | // int recvFrom(void *buffer, int bufferLen, std::string &sourceAddress, 36 | // unsigned short &sourcePort); 37 | // void setMulticastTTL(unsigned char multicastTTL); 38 | // void joinGroup(const std::string &multicastGroup); 39 | // void leaveGroup(const std::string &multicastGroup); 40 | 41 | // private: 42 | // void setBroadcast(); 43 | 44 | protected: 45 | virtual ~SocketUDP(); 46 | }; 47 | 48 | } // namespace OpenRTI 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/rti1516/RTI/RTI1516.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | IEEE 1516.1 High Level Architecture Interface Specification C++ API 3 | File: RTI/1516.h 4 | ***********************************************************************/ 5 | 6 | // 7 | // This file is simply a convenience provided for those developers that would 8 | // like to include everything all at once 9 | // 10 | 11 | #ifndef RTI_1516_h 12 | #define RTI_1516_h 13 | 14 | // Identification of the API version number. 15 | #define HLA_SPECIFICATION_NAME "1516" 16 | #define HLA_API_MAJOR_VERSION 2 17 | #define HLA_API_MINOR_VERSION 0 18 | 19 | // This file contains platform specific configuration info. 20 | #include 21 | 22 | // These file include declarations/definitions for ISO 14882 standard C++ 23 | // classes, renamed for portability. 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | // This file contains standard RTI type declarations/definitions. 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | // This file contains standard RTI type declarations/definitions which depend on 37 | // RTI implementation specific declarations/definitions. 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | namespace rti1516 44 | { 45 | // Vendor-specific name and version of the RTI implementation 46 | std::wstring RTI_EXPORT RTIname(); 47 | std::wstring RTI_EXPORT RTIversion(); 48 | } 49 | 50 | #include 51 | #include 52 | #include 53 | 54 | #endif // RTI_1516_h 55 | -------------------------------------------------------------------------------- /src/rti1516/HLAinteger64TimeFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | // This time, the first include is above the api include. 21 | // the rti1516/Exception header misses that. 22 | #include 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | HLAinteger64TimeFactory::HLAinteger64TimeFactory() 32 | { 33 | } 34 | 35 | HLAinteger64TimeFactory::~HLAinteger64TimeFactory() 36 | RTI_NOEXCEPT 37 | { 38 | } 39 | 40 | RTI_UNIQUE_PTR 41 | HLAinteger64TimeFactory::makeLogicalTime() 42 | RTI_THROW ((rti1516::InternalError)) 43 | { 44 | return RTI_UNIQUE_PTR(new HLAinteger64Time); 45 | } 46 | 47 | RTI_UNIQUE_PTR 48 | HLAinteger64TimeFactory::makeLogicalTimeInterval() 49 | RTI_THROW ((rti1516::InternalError)) 50 | { 51 | return RTI_UNIQUE_PTR(new HLAinteger64Interval); 52 | } 53 | -------------------------------------------------------------------------------- /src/OpenRTI/NestedProtocolLayer.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "NestedProtocolLayer.h" 21 | 22 | namespace OpenRTI { 23 | 24 | NestedProtocolLayer::NestedProtocolLayer() 25 | { 26 | } 27 | 28 | NestedProtocolLayer::~NestedProtocolLayer() 29 | { 30 | } 31 | 32 | void 33 | NestedProtocolLayer::read(AbstractProtocolSocket& protocolSocket) 34 | { 35 | _protocolLayer->read(protocolSocket); 36 | } 37 | 38 | bool 39 | NestedProtocolLayer::getEnableRead() const 40 | { 41 | return _protocolLayer.valid() && _protocolLayer->getEnableRead(); 42 | } 43 | 44 | void 45 | NestedProtocolLayer::write(AbstractProtocolSocket& protocolSocket) 46 | { 47 | _protocolLayer->write(protocolSocket); 48 | } 49 | 50 | bool 51 | NestedProtocolLayer::getEnableWrite() const 52 | { 53 | return _protocolLayer.valid() && _protocolLayer->getEnableWrite(); 54 | } 55 | 56 | void 57 | NestedProtocolLayer::error(const Exception& e) 58 | { 59 | if (!_protocolLayer.valid()) 60 | return; 61 | _protocolLayer->error(e); 62 | } 63 | 64 | } // namespace OpenRTI 65 | -------------------------------------------------------------------------------- /src/OpenRTI/TightBE1MessageEncoding.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * 4 | * This file is part of OpenRTI. 5 | * 6 | * OpenRTI is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * OpenRTI is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with OpenRTI. If not, see . 18 | * 19 | * This file is autogenerated by messagegen.py. Do not edit! 20 | * 21 | */ 22 | 23 | #ifndef OpenRTI_TightBE1MessageEncoding_h 24 | #define OpenRTI_TightBE1MessageEncoding_h 25 | 26 | #include "AbstractMessageEncoding.h" 27 | #include "Export.h" 28 | 29 | namespace OpenRTI { 30 | 31 | class OPENRTI_LOCAL TightBE1MessageEncoding : public AbstractMessageEncoding { 32 | public: 33 | TightBE1MessageEncoding(); 34 | virtual ~TightBE1MessageEncoding(); 35 | 36 | virtual const char* getName() const; 37 | 38 | virtual void readPacket(const Buffer& buffer); 39 | void decodeBody(const VariableLengthData& variableLengthData); 40 | void decodePayload(const Buffer::const_iterator& i); 41 | virtual void writeMessage(const AbstractMessage& message); 42 | 43 | private: 44 | class DecodeStream; 45 | class DispatchFunctor; 46 | class PayloadDecoder; 47 | class EncodeStream; 48 | 49 | SharedPtr _message; 50 | }; 51 | 52 | } // namespace OpenRTI 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/OpenRTI/posix/ConditionPosix.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "Condition.h" 21 | 22 | #include "Clock.h" 23 | #include "ScopeLock.h" 24 | #include "MutexPrivateDataPosix.h" 25 | #include "ConditionPrivateDataPosix.h" 26 | 27 | namespace OpenRTI { 28 | 29 | #if __cplusplus < 201103L 30 | 31 | Condition::Condition(void) : 32 | _privateData(new PrivateData) 33 | { 34 | } 35 | 36 | Condition::~Condition(void) 37 | { 38 | delete _privateData; 39 | _privateData = 0; 40 | } 41 | 42 | void 43 | Condition::notify_one(void) 44 | { 45 | _privateData->notify_one(); 46 | } 47 | 48 | void 49 | Condition::notify_all(void) 50 | { 51 | _privateData->notify_all(); 52 | } 53 | 54 | void 55 | Condition::wait(ScopeLock& scopeLock) 56 | { 57 | _privateData->wait(scopeLock.mutex()->_privateData->_mutex); 58 | } 59 | 60 | bool 61 | Condition::wait_until(ScopeLock& scopeLock, const Clock& timeout) 62 | { 63 | return _privateData->wait_until(scopeLock.mutex()->_privateData->_mutex, timeout); 64 | } 65 | 66 | #endif 67 | 68 | } // namespace OpenRTI 69 | -------------------------------------------------------------------------------- /src/RTI13/FederateHandleSetImplementation.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef FederateHandleSetImplementation_h 21 | #define FederateHandleSetImplementation_h 22 | 23 | /// The original RTI13 include 24 | #include 25 | 26 | #include 27 | #include "Handle.h" 28 | 29 | class OPENRTI_LOCAL FederateHandleSetImplementation : public RTI::FederateHandleSet { 30 | public: 31 | FederateHandleSetImplementation(RTI::ULong size); 32 | virtual ~FederateHandleSetImplementation(); 33 | 34 | virtual RTI::ULong size() const; 35 | virtual RTI::FederateHandle getHandle(RTI::ULong index) const 36 | RTI_THROW ((RTI::ArrayIndexOutOfBounds)); 37 | virtual void add(RTI::FederateHandle handle) 38 | RTI_THROW ((RTI::ValueCountExceeded)); 39 | virtual void remove(RTI::FederateHandle handle) 40 | RTI_THROW ((RTI::ArrayIndexOutOfBounds)); 41 | virtual void empty(); 42 | virtual RTI::Boolean isMember(RTI::FederateHandle handle) const; 43 | 44 | private: 45 | std::vector _federateHandleVector; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/OpenRTI/Options.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_Options_h 21 | #define OpenRTI_Options_h 22 | 23 | #include 24 | #include 25 | #include "Export.h" 26 | 27 | namespace OpenRTI { 28 | 29 | // Simple portable getopt rplacement. 30 | class OPENRTI_API Options { 31 | public: 32 | Options(int argc, const char* const argv[]); 33 | ~Options(); 34 | 35 | // The current options character 36 | char getOptChar() const 37 | { return _optChar; } 38 | 39 | // The current option argument, if the option character is != 0 40 | // A usual non option argument if the option character is == 0 41 | const std::string& getArgument() const 42 | { return _argument; } 43 | 44 | // Returns true as long as there are options to process. 45 | // Takes the current list of arguments on getopt style 46 | bool next(const char *opts); 47 | 48 | private: 49 | int _argc; 50 | const char* const* _argv; 51 | std::string _argument; 52 | unsigned _optCharIndex; 53 | int _optIndex; 54 | char _optChar; 55 | }; 56 | 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/OpenRTI/xml/asciitab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 6 | /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 7 | /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, 8 | /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, 9 | /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 10 | /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 11 | /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 12 | /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 13 | /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, 14 | /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, 15 | /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, 16 | /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, 17 | /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 18 | /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, 19 | /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, 20 | /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, 21 | /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 22 | /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 23 | /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 24 | /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 25 | /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 26 | /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 27 | /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, 28 | /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, 29 | /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, 30 | /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, 31 | /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 32 | /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 33 | /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 34 | /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, 35 | /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, 36 | /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, 37 | -------------------------------------------------------------------------------- /include/rti1516e/RTI/RangeBounds.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | The IEEE hereby grants a general, royalty-free license to copy, distribute, 3 | display and make derivative works from this material, for all purposes, 4 | provided that any use of the material contains the following 5 | attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010". 6 | Should you require additional information, contact the Manager, Standards 7 | Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org). 8 | ***********************************************************************/ 9 | /*********************************************************************** 10 | IEEE 1516.1 High Level Architecture Interface Specification C++ API 11 | File: RTI/RangeBounds.h 12 | ***********************************************************************/ 13 | 14 | #ifndef RTI_RangeBounds_h 15 | #define RTI_RangeBounds_h 16 | 17 | #include 18 | 19 | namespace rti1516e 20 | { 21 | class RTI_EXPORT RangeBounds 22 | { 23 | public: 24 | RangeBounds (); 25 | 26 | RangeBounds ( 27 | unsigned long lowerBound, 28 | unsigned long upperBound); 29 | 30 | ~RangeBounds () 31 | RTI_NOEXCEPT; 32 | 33 | RangeBounds ( 34 | RangeBounds const & rhs); 35 | 36 | RangeBounds & operator= ( 37 | RangeBounds const & rhs); 38 | 39 | unsigned long getLowerBound () const; 40 | 41 | unsigned long getUpperBound () const; 42 | 43 | void setLowerBound ( 44 | unsigned long lowerBound); 45 | 46 | void setUpperBound ( 47 | unsigned long upperBound); 48 | 49 | private: 50 | unsigned long _lowerBound; 51 | unsigned long _upperBound; 52 | }; 53 | } 54 | 55 | #endif // RTI_RangeBounds_h 56 | -------------------------------------------------------------------------------- /src/OpenRTI/xml/utf8tab.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 | See the file COPYING for copying permission. 3 | */ 4 | 5 | 6 | /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 7 | /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 8 | /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 9 | /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 10 | /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 11 | /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 12 | /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 13 | /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 14 | /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 15 | /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 16 | /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 17 | /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 18 | /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 19 | /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 20 | /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 21 | /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, 22 | /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 23 | /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 24 | /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 25 | /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 26 | /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 27 | /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 28 | /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 29 | /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, 30 | /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 31 | /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 32 | /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 33 | /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, 34 | /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, 35 | /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, 36 | /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, 37 | /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, 38 | -------------------------------------------------------------------------------- /src/RTI13/AttributeHandleSetImplementation.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef AttributeHandleSetImplementation_h 21 | #define AttributeHandleSetImplementation_h 22 | 23 | /// The original RTI13 include 24 | #include 25 | 26 | #include "Handle.h" 27 | 28 | class OPENRTI_LOCAL AttributeHandleSetImplementation : public RTI::AttributeHandleSet { 29 | public: 30 | AttributeHandleSetImplementation(RTI::ULong size); 31 | virtual ~AttributeHandleSetImplementation(); 32 | 33 | virtual RTI::ULong size() const; 34 | virtual RTI::AttributeHandle getHandle(RTI::ULong index) const 35 | RTI_THROW ((RTI::ArrayIndexOutOfBounds)); 36 | virtual void add(RTI::AttributeHandle handle) 37 | RTI_THROW ((RTI::ArrayIndexOutOfBounds, RTI::AttributeNotDefined)); 38 | virtual void remove(RTI::AttributeHandle handle) 39 | RTI_THROW ((RTI::AttributeNotDefined)); 40 | virtual void empty(); 41 | virtual RTI::Boolean isEmpty() const; 42 | virtual RTI::Boolean isMember(RTI::AttributeHandle handle) const; 43 | 44 | private: 45 | std::vector _attributeHandleVector; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/OpenRTI/InitialClientStreamProtocol.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_InitialClientStreamProtocol_h 21 | #define OpenRTI_InitialClientStreamProtocol_h 22 | 23 | #include "InitialStreamProtocol.h" 24 | 25 | namespace OpenRTI { 26 | 27 | class AbstractServer; 28 | 29 | class OPENRTI_API InitialClientStreamProtocol : public InitialStreamProtocol { 30 | public: 31 | InitialClientStreamProtocol(AbstractServer& abstractServer); 32 | InitialClientStreamProtocol(AbstractServer& abstractServer, const StringStringListMap& connectOptions); 33 | virtual ~InitialClientStreamProtocol(); 34 | 35 | void setConnectOptions(StringStringListMap connectOptions); 36 | virtual void readOptionMap(const StringStringListMap& optionMap); 37 | 38 | virtual void error(const Exception& e); 39 | 40 | bool getSuccessfulConnect() const 41 | { return _successfulConnect; } 42 | const std::string& getErrorMessage() const 43 | { return _errorMessage; } 44 | 45 | private: 46 | AbstractServer& _abstractServer; 47 | std::string _errorMessage; 48 | bool _successfulConnect; 49 | }; 50 | 51 | } // namespace OpenRTI 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/RTI13/AttributeHandleSetCallback.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef AttributeHandleSetCallback_h 21 | #define AttributeHandleSetCallback_h 22 | 23 | /// The original RTI13 include 24 | #include 25 | 26 | #include "Handle.h" 27 | 28 | class OPENRTI_LOCAL AttributeHandleSetCallback : public RTI::AttributeHandleSet { 29 | public: 30 | AttributeHandleSetCallback(const std::vector& attributeHandleVector); 31 | virtual ~AttributeHandleSetCallback(); 32 | 33 | virtual RTI::ULong size() const; 34 | virtual RTI::AttributeHandle getHandle(RTI::ULong index) const 35 | RTI_THROW ((RTI::ArrayIndexOutOfBounds)); 36 | virtual void add(RTI::AttributeHandle handle) 37 | RTI_THROW ((RTI::ArrayIndexOutOfBounds, RTI::AttributeNotDefined)); 38 | virtual void remove(RTI::AttributeHandle handle) 39 | RTI_THROW ((RTI::AttributeNotDefined)); 40 | virtual void empty(); 41 | virtual RTI::Boolean isEmpty() const; 42 | virtual RTI::Boolean isMember(RTI::AttributeHandle handle) const; 43 | 44 | private: 45 | const std::vector& _attributeHandleVector; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /tests/rti1516e/modules/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(modules-1516e modules.cpp) 2 | target_link_libraries(modules-1516e rti1516e fedtime1516e OpenRTI) 3 | 4 | # # No server - thread protocol, one ambassador 5 | # add_test(rti1516e/modules-1516e-1 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S0 -A1 -D -O "${CMAKE_CURRENT_SOURCE_DIR}") 6 | # # No server - thread protocol, 10 ambassadors 7 | # add_test(rti1516e/modules-1516e-2 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S0 -A10 -D -O "${CMAKE_CURRENT_SOURCE_DIR}") 8 | # # 1 server - rti protocol, one ambassador 9 | # add_test(rti1516e/modules-1516e-3 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S1 -A1 -D -O "${CMAKE_CURRENT_SOURCE_DIR}") 10 | # # 1 server - rti protocol, 10 ambassadors 11 | # add_test(rti1516e/modules-1516e-4 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S1 -A10 -D -O "${CMAKE_CURRENT_SOURCE_DIR}") 12 | # 5 servers - rti protocol, 10 ambassadors 13 | add_test(rti1516e/modules-1516e-5 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S5 -A10 -D -O "${CMAKE_CURRENT_SOURCE_DIR}") 14 | 15 | # No server - thread protocol, one ambassador 16 | add_test(rti1516e/modules-1516e-6 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S0 -A1 -O "${CMAKE_CURRENT_SOURCE_DIR}") 17 | # No server - thread protocol, 10 ambassadors 18 | add_test(rti1516e/modules-1516e-7 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S0 -A10 -O "${CMAKE_CURRENT_SOURCE_DIR}") 19 | # 1 server - rti protocol, one ambassador 20 | add_test(rti1516e/modules-1516e-8 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S1 -A1 -O "${CMAKE_CURRENT_SOURCE_DIR}") 21 | # 1 server - rti protocol, 10 ambassadors 22 | add_test(rti1516e/modules-1516e-9 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S1 -A10 -O "${CMAKE_CURRENT_SOURCE_DIR}") 23 | # 5 servers - rti protocol, 10 ambassadors 24 | add_test(rti1516e/modules-1516e-10 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modules-1516e" -S5 -A10 -O "${CMAKE_CURRENT_SOURCE_DIR}") 25 | -------------------------------------------------------------------------------- /src/OpenRTI/ThreadLocal.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_ThreadLocal_h 21 | #define OpenRTI_ThreadLocal_h 22 | 23 | #include "Export.h" 24 | 25 | namespace OpenRTI { 26 | 27 | class OPENRTI_API AbstractThreadLocal { 28 | protected: 29 | AbstractThreadLocal(); 30 | ~AbstractThreadLocal(); 31 | 32 | struct OPENRTI_API _AbstractData { 33 | virtual ~_AbstractData(); 34 | }; 35 | 36 | _AbstractData* _get(); 37 | void _set(_AbstractData*); 38 | 39 | private: 40 | AbstractThreadLocal(const AbstractThreadLocal&); 41 | AbstractThreadLocal& operator=(const AbstractThreadLocal&); 42 | 43 | struct _Provider; 44 | 45 | unsigned _index; 46 | }; 47 | 48 | template 49 | class OPENRTI_API ThreadLocal : public AbstractThreadLocal { 50 | public: 51 | T* instance() 52 | { 53 | _Data* value; 54 | value = static_cast<_Data*>(_get()); 55 | if (!value) { 56 | value = new _Data(); 57 | _set(value); 58 | } 59 | return &value->_value; 60 | } 61 | private: 62 | struct _Data : public _AbstractData { 63 | T _value; 64 | }; 65 | }; 66 | 67 | } // namespace OpenRTI 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /src/OpenRTI/Mutex.h: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2004-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OpenRTI_Mutex_h 21 | #define OpenRTI_Mutex_h 22 | 23 | #include "Export.h" 24 | 25 | #if 201103L <= __cplusplus 26 | # include 27 | #endif 28 | 29 | namespace OpenRTI { 30 | 31 | class Condition; 32 | class ScopeLock; 33 | 34 | class OPENRTI_API Mutex { 35 | public: 36 | #if 201103L <= __cplusplus 37 | Mutex(void) 38 | { } 39 | #else 40 | Mutex(void); 41 | #endif 42 | #if 201103L <= __cplusplus 43 | ~Mutex(void) 44 | { } 45 | #else 46 | ~Mutex(void); 47 | #endif 48 | 49 | #if 201103L <= __cplusplus 50 | void lock(void) 51 | { _mutex.lock(); } 52 | #else 53 | void lock(void); 54 | #endif 55 | #if 201103L <= __cplusplus 56 | void unlock(void) 57 | { _mutex.unlock(); } 58 | #else 59 | void unlock(void); 60 | #endif 61 | 62 | private: 63 | Mutex(const Mutex&); 64 | Mutex& operator=(const Mutex&); 65 | 66 | #if 201103L <= __cplusplus 67 | std::mutex _mutex; 68 | #else 69 | struct PrivateData; 70 | PrivateData* _privateData; 71 | #endif 72 | 73 | friend class Condition; 74 | friend class ScopeLock; 75 | }; 76 | 77 | } // namespace OpenRTI 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/OpenRTI/AbstractMessageEncoding.cpp: -------------------------------------------------------------------------------- 1 | /* -*-c++-*- OpenRTI - Copyright (C) 2009-2023 Mathias Froehlich 2 | * 3 | * This file is part of OpenRTI. 4 | * 5 | * OpenRTI is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as published by 7 | * the Free Software Foundation, either version 2.1 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenRTI is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with OpenRTI. If not, see . 17 | * 18 | */ 19 | 20 | #include "AbstractMessageEncoding.h" 21 | 22 | #include "Message.h" 23 | 24 | namespace OpenRTI { 25 | 26 | AbstractMessageEncoding::AbstractMessageEncoding() 27 | { 28 | } 29 | 30 | AbstractMessageEncoding::~AbstractMessageEncoding() 31 | { 32 | } 33 | 34 | bool 35 | AbstractMessageEncoding::getEnableRead() const 36 | { 37 | return true; 38 | } 39 | 40 | void 41 | AbstractMessageEncoding::writePacket() 42 | { 43 | SharedPtr message = _connect->receive(); 44 | if (!message.valid()) 45 | return; 46 | writeMessage(*message); 47 | } 48 | 49 | bool AbstractMessageEncoding::getMoreToSend() const 50 | { 51 | return !_connect->empty(); 52 | } 53 | 54 | void 55 | AbstractMessageEncoding::error(const Exception& e) 56 | { 57 | /// FIXME!!!, just have a ConnectionClosed message. Depending on the server nodes state, it can decide what to do 58 | SharedPtr message = new ConnectionLostMessage; 59 | message->setFaultDescription(e.getReason()); 60 | _connect->send(message); 61 | _connect->close(); 62 | } 63 | 64 | } // namespace OpenRTI 65 | --------------------------------------------------------------------------------