From 6e7b09cf6f2381533e1e34513d5606e2910c84d2 Mon Sep 17 00:00:00 2001 From: berrux_dev Date: Wed, 14 Oct 2026 16:51:32 +0200 Subject: [PATCH] Remove include/ entries and LogView files unused by the release-scope build Audited the release-scope compilation (TetraIF, Z/src, Lts/Common + TrainingAreaBase, BUILD_RTI=OFF) for every file under include/: Removed (zero references from release-scope sources or CMake): - service-stub header dirs (AlarmManagement, AreaEffectSimulation, AssetManagement, AudioVideoManagement, Core, ExerciseEventManagement, ExerciseManagement, GuezNasat, InfrastructureManagement, Lts, LtsProjectionWorkstation, LtsScriptTimeline, LtsSession, MarkerManagement, NotificationManagement, OperatorManagement, ParticipantManagement, ProjectDataManagement, ReportManagement, Services, SituationReplay, TopicEditorBase, Viewer) - include/grantlee (codegen modules excluded from the release build) - include/nglapplication (all headers duplicate Z/src/nglapplication) - include/poppler (Qt5 header; the build includes poppler/qt6 from the system package) - include/rti (142 Connext DDS headers; only consumers are behind BUILD_RTI, which is OFF for this branch) - TetraIF/LogView zsksxd_tetraForLogView{,_guez}.cpp and zsksxd_tetraForLogView_guez.x (the build compiles the .x; the guez variant is referenced nowhere; LogView loads the .x from the app dir) Kept (actively included): include/GeographicLib, include/LtsUtilsGuiDds, include/NGLLogger. Also drop the now-dangling include_directories for the removed dirs in the top-level CMakeLists (include/Viewer/SituationMap) and Lts/CMakeLists.txt (six stub dirs) - otherwise GCC warns -Wmissing-include-dirs for every compile. Verified with a full pipeline rebuild (scope-rebuild15): 0 warnings, ctest baseline unchanged, all 5 DEBs produced. --- qt6-after/qt6-migrated-legatus/CMakeLists.txt | 1 - .../qt6-migrated-legatus/Lts/CMakeLists.txt | 8 +- .../LogView/zsksxd_tetraForLogView.cpp | 1 - .../LogView/zsksxd_tetraForLogView_guez.cpp | 1 - .../LogView/zsksxd_tetraForLogView_guez.x | 1839 ---------- .../AlarmManagement/svcalmcommon_export.h | 8 - .../AreaEffectSimulation/aes_enums.hpp.stub | 28 - .../AssetManagement/asm_enums.hpp.stub | 28 - .../AudioVideoManagement/avm_enums.hpp.stub | 34 - .../include/Core/core_enums.hpp.stub | 24 - .../eem_enums.hpp.stub | 24 - .../exm_data_plugin_interface.h | 27 - .../ExerciseManagement/exm_enums.hpp.stub | 34 - .../include/ExerciseManagement/exm_exercise.h | 33 - .../ExerciseManagement/exmcommon_export.h | 10 - .../include/GuezNasat/gna_nasat_aircraft.h | 72 - .../gna_nasat_aircraft_participant.h | 5 - .../include/GuezNasat/gna_translation.h | 29 - .../include/GuezNasat/svcgnacommon_export.h | 7 - .../ism_enums.hpp.stub | 69 - .../ism_mounting_point.h | 145 - .../Common/ProjectConfig/project_defines.h | 78 - .../ltsprojectionworkstation_export.h | 26 - .../ltsscripttimeline_export.h | 12 - .../include/LtsSession/ltssession_export.h | 22 - .../LtsSession/ltssessiondata_export.h | 21 - .../include/MarkerManagement/mrk_marker.h | 55 - .../MarkerManagement/mrkcommon_export.h | 14 - .../NotificationManagement/nom_enums.hpp.stub | 25 - .../opm_data_plugin_interface.h | 43 - .../OperatorManagement/opm_enums.hpp.stub | 31 - .../ParticipantManagement/ppm_enums.hpp.stub | 49 - .../ParticipantManagement/ppmcommon_export.h | 10 - .../project_data_management.hpp | 36 - .../ReportManagement/rep_enums.hpp.stub | 24 - .../svcprecommon_export.h | 21 - .../SituationReplay/srp_enums.hpp.stub | 25 - .../TopicEditorBase/topiceditorbase_export.h | 11 - .../ElevationMap/elevation_map_manager.h | 75 - .../include/grantlee/abstractlocalizer.h | 163 - .../include/grantlee/abstractmarkupbuilder.h | 273 -- .../include/grantlee/bbcodebuilder.h | 113 - .../include/grantlee/cachingloaderdecorator.h | 112 - .../include/grantlee/context.h | 283 -- .../include/grantlee/engine.h | 259 -- .../include/grantlee/exception.h | 120 - .../include/grantlee/filter.h | 117 - .../include/grantlee/filterexpression.h | 200 -- .../grantlee/grantlee_templates_export.h | 42 - .../grantlee/grantlee_textdocument_export.h | 42 - .../include/grantlee/grantlee_version.h | 7 - .../include/grantlee/markupdirector.h | 306 -- .../include/grantlee/mediawikimarkupbuilder.h | 79 - .../include/grantlee/metatype.h | 244 -- .../include/grantlee/node.h | 380 --- .../include/grantlee/outputstream.h | 145 - .../include/grantlee/parser.h | 144 - .../include/grantlee/plaintextmarkupbuilder.h | 211 -- .../include/grantlee/qtlocalizer.h | 135 - .../include/grantlee/rendercontext.h | 83 - .../include/grantlee/safestring.h | 436 --- .../include/grantlee/taglibraryinterface.h | 110 - .../include/grantlee/template.h | 161 - .../include/grantlee/templateloader.h | 229 -- .../include/grantlee/texthtmlbuilder.h | 238 -- .../include/grantlee/token.h | 57 - .../include/grantlee/typeaccessor.h | 48 - .../include/grantlee/util.h | 111 - .../include/grantlee/variable.h | 129 - .../include/nglapplication/CMakeLists.txt | 138 - .../nglapplication/ngl_qt_msg_handler.inc | 64 - .../nglapplication/ngl_signal_handler.inc | 41 - .../include/nglapplication/nglapplication.cpp | 36 - .../include/nglapplication/nglapplication.h | 41 - .../nglapplication/nglcoreapplication.cpp | 22 - .../nglapplication/nglcoreapplication.h | 36 - .../nglapplication/nglguiapplication.cpp | 22 - .../nglapplication/nglguiapplication.h | 38 - .../nglapplication/nglloggerhandler.cpp | 96 - .../include/nglapplication/nglloggerhandler.h | 88 - .../nglapplication/nglsingleapplication.cpp | 37 - .../nglapplication/nglsingleapplication.h | 41 - .../nglsinglecoreapplication.cpp | 22 - .../nglapplication/nglsinglecoreapplication.h | 36 - .../include/poppler/qt5/poppler-qt5.h | 7 - .../include/rti/apputils/DynamicBuffer.hpp | 144 - .../rti/apputils/DynamicDataConverter.hpp | 247 -- .../include/rti/apputils/EntityId.hpp | 243 -- .../rti/apputils/ResourceIdentifier.hpp | 395 --- .../include/rti/apputils/SQLiteConnection.hpp | 1065 ------ .../include/rti/apputils/ServiceException.hpp | 205 -- .../include/rti/apputils/StringBuffer.hpp | 295 -- .../rti/apputils/http/client/Connection.hpp | 355 -- .../rti/apputils/http/client/Request.hpp | 202 -- .../test/CivetWebSocketConnectionTester.h | 177 - .../apputils/http/common/HttpException.hpp | 74 - .../rti/apputils/http/common/HttpUtils.hpp | 167 - .../rti/apputils/http/common/Method.hpp | 96 - .../rti/apputils/http/common/Response.hpp | 51 - .../rti/apputils/http/common/StatusCode.hpp | 90 - .../rti/apputils/http/common/WebSocketUtils.h | 100 - .../include/rti/apputils/http/log/Log.hpp | 41 - .../http/server/CivetWebSocketConnection.hpp | 84 - .../rti/apputils/http/server/Connection.hpp | 292 -- .../rti/apputils/http/server/Request.hpp | 232 -- .../apputils/http/server/RequestHandler.hpp | 157 - .../rti/apputils/http/server/Server.hpp | 125 - .../apputils/http/server/ServerProperty.hpp | 213 -- .../http/server/WebSocketConnection.hpp | 320 -- .../http/server/detail/CivetWebHandler.hpp | 209 -- .../detail/CivetWebSocketHandlerImpl.hpp | 165 - .../http/server/detail/WebSocketHandler.hpp | 63 - .../include/rti/apputils/log/LogConfig.hpp | 304 -- .../rti/apputils/monitoring/Counters.hpp | 37 - .../include/rti/apputils/monitoring/Utils.hpp | 52 - .../rti/apputils/test/SqliteVerifier.hpp | 214 -- .../rti/apputils/test/TestFramework.hpp | 1506 --------- .../rti/apputils/test/TestLogCapture.hpp | 95 - .../rti/apputils/util/LockedBuffer.hpp | 83 - .../include/rti/apputils/util/Path.hpp | 495 --- .../include/rti/apputils/util/Utils.hpp | 122 - .../apputils/util/VersionableComponent.hpp | 155 - .../include/rti/cds/Logger.hpp | 223 -- .../include/rti/cds/PropertySet.hpp | 14 - .../include/rti/cds/Service.hpp | 200 -- .../include/rti/cds/ServiceProperty.hpp | 678 ---- .../cds/detail/CloudDiscoveryServiceImpl.hpp | 86 - .../include/rti/flat/AggregationBuilders.hpp | 558 ---- .../include/rti/flat/Builder.hpp | 1007 ------ .../include/rti/flat/BuilderHelper.hpp | 220 -- .../include/rti/flat/ExceptionHelper.hpp | 179 - .../include/rti/flat/FlatSample.hpp | 451 --- .../include/rti/flat/FlatSampleImpl.hpp | 76 - .../include/rti/flat/FlatTypeTraits.hpp | 264 -- .../include/rti/flat/Offset.hpp | 1203 ------- .../include/rti/flat/SequenceBuilders.hpp | 952 ------ .../include/rti/flat/SequenceIterator.hpp | 345 -- .../include/rti/flat/SequenceOffsets.hpp | 844 ----- .../include/rti/flat/rtiflat.hpp | 171 - .../rti/idlgen/RecordingServiceMonitoring.hpp | 2440 -------------- .../RecordingServiceMonitoringPlugin.hpp | 2958 ----------------- .../rti/idlgen/RecordingServiceTypes.hpp | 925 ------ .../idlgen/RecordingServiceTypesPlugin.hpp | 1179 ------- .../include/rti/idlgen/ServiceAdmin.hpp | 534 --- .../include/rti/idlgen/ServiceAdminPlugin.hpp | 834 ----- .../include/rti/idlgen/ServiceCommon.hpp | 1803 ---------- .../rti/idlgen/ServiceCommonPlugin.hpp | 2625 --------------- .../monitoring/collector/CollectorService.hpp | 6 - .../include/rti/monitoring/collector/Dll.h | 40 - .../include/rti/monitoring/collector/Log.h | 85 - .../rti/monitoring/collector/Logger.hpp | 172 - .../rti/monitoring/collector/PropertySet.hpp | 13 - .../rti/monitoring/collector/Service.hpp | 209 -- .../monitoring/collector/ServiceProperty.hpp | 316 -- .../collector/detail/CollectorServiceImpl.hpp | 63 - .../include/rti/recording/Logger.hpp | 174 - .../include/rti/recording/PropertySet.hpp | 13 - .../rti/recording/RecordingService.hpp | 6 - .../include/rti/recording/Service.hpp | 295 -- .../include/rti/recording/ServiceProperty.hpp | 579 ---- .../include/rti/recording/StreamInfo.hpp | 13 - .../recording/detail/RecordingServiceImpl.hpp | 72 - .../rti/recording/storage/EStorageFormat.hpp | 145 - .../rti/recording/storage/SelectorState.hpp | 250 -- .../rti/recording/storage/StorageDefs.hpp | 251 -- .../storage/StorageDiscoveryStreamWriter.hpp | 56 - .../rti/recording/storage/StorageReader.hpp | 239 -- .../storage/StorageStreamInfoReader.hpp | 110 - .../recording/storage/StorageStreamReader.hpp | 199 -- .../recording/storage/StorageStreamWriter.hpp | 128 - .../rti/recording/storage/StorageWriter.hpp | 201 -- .../storage/detail/StorageReaderForwarder.hpp | 177 - .../StorageStreamInfoReaderForwarder.hpp | 239 -- .../detail/StorageStreamReaderForwarder.hpp | 194 -- .../detail/StorageStreamWriterForwarder.hpp | 268 -- .../storage/detail/StorageWriterForwarder.hpp | 270 -- .../include/rti/routing/EntityListener.hpp | 426 --- .../include/rti/routing/Logger.hpp | 219 -- .../include/rti/routing/PropertySet.hpp | 64 - .../include/rti/routing/RoutingService.hpp | 17 - .../include/rti/routing/Service.hpp | 404 --- .../include/rti/routing/ServiceProperty.hpp | 563 ---- .../include/rti/routing/StreamInfo.hpp | 210 -- .../include/rti/routing/TypeInfo.hpp | 322 -- .../include/rti/routing/UpdatableEntity.hpp | 60 - .../rti/routing/adapter/AdapterPlugin.hpp | 202 -- .../rti/routing/adapter/Connection.hpp | 263 -- .../routing/adapter/DiscoveryStreamReader.hpp | 147 - .../include/rti/routing/adapter/Session.hpp | 42 - .../rti/routing/adapter/StreamReader.hpp | 666 ---- .../routing/adapter/StreamReaderListener.hpp | 22 - .../rti/routing/adapter/StreamWriter.hpp | 151 - .../adapter/detail/AdapterForwarder.hpp | 110 - .../adapter/detail/ConnectionForwarder.hpp | 335 -- .../detail/DiscoveryStreamReaderForwarder.hpp | 134 - .../rti/routing/adapter/detail/ReadProxy.h | 106 - .../adapter/detail/SessionForwarder.hpp | 151 - .../adapter/detail/StreamReaderForwarder.hpp | 524 --- .../detail/StreamReaderListenerForwarder.hpp | 75 - .../adapter/detail/StreamWriterForwarder.hpp | 207 -- .../rti/routing/detail/ForwarderUtils.hpp | 105 - .../rti/routing/detail/RoutingServiceImpl.hpp | 243 -- .../routing/detail/ShutdownHookForwarder.hpp | 79 - .../detail/UpdatableEntityForwarder.hpp | 61 - .../include/rti/routing/log/LogConfig.hpp | 73 - .../include/rti/routing/processor/Input.hpp | 703 ---- .../rti/routing/processor/LoanedSample.hpp | 130 - .../rti/routing/processor/LoanedSamples.hpp | 306 -- .../include/rti/routing/processor/Output.hpp | 326 -- .../rti/routing/processor/PortIterator.hpp | 202 -- .../rti/routing/processor/Processor.hpp | 397 --- .../rti/routing/processor/ProcessorPlugin.hpp | 389 --- .../include/rti/routing/processor/Query.hpp | 138 - .../include/rti/routing/processor/Route.hpp | 555 ---- .../rti/routing/processor/SampleIterator.hpp | 275 -- .../processor/detail/ProcessorForwarder.hpp | 353 -- .../detail/ProcessorPluginForwarder.hpp | 99 - .../rti/routing/transf/Transformation.hpp | 223 -- .../routing/transf/TransformationPlugin.hpp | 221 -- .../transf/detail/TransformationForwarder.hpp | 257 -- .../detail/TransformationPluginForwarder.hpp | 104 - .../include/rti/webdds/Dll.hpp | 43 - .../include/rti/webdds/Service.hpp | 136 - .../include/rti/webdds/ServiceProperty.hpp | 341 -- .../detail/WebIntegrationServiceImpl.hpp | 45 - .../include/rti/xcdr/Interpreter.hpp | 259 -- .../include/rti/xcdr/Stream.hpp | 429 --- 227 files changed, 1 insertion(+), 55080 deletions(-) delete mode 120000 qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView.cpp delete mode 120000 qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.cpp delete mode 100644 qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.x delete mode 100644 qt6-after/qt6-migrated-legatus/include/AlarmManagement/svcalmcommon_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/AreaEffectSimulation/aes_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/AssetManagement/asm_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/AudioVideoManagement/avm_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/Core/core_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/ExerciseEventManagement/eem_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_data_plugin_interface.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_exercise.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exmcommon_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft_participant.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_translation.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/GuezNasat/svcgnacommon_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_enums.hpp.stub delete mode 100755 qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_mounting_point.h delete mode 100755 qt6-after/qt6-migrated-legatus/include/Lts/Common/ProjectConfig/project_defines.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/LtsProjectionWorkstation/ltsprojectionworkstation_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/LtsScriptTimeline/ltsscripttimeline_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/LtsSession/ltssession_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/LtsSession/ltssessiondata_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrk_marker.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrkcommon_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/NotificationManagement/nom_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_data_plugin_interface.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppm_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppmcommon_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/ProjectDataManagement/project_data_management.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/ReportManagement/rep_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/Services/PresentationManagement/svcprecommon_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/SituationReplay/srp_enums.hpp.stub delete mode 100644 qt6-after/qt6-migrated-legatus/include/TopicEditorBase/topiceditorbase_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/Viewer/SituationMap/ElevationMap/elevation_map_manager.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/abstractlocalizer.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/abstractmarkupbuilder.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/bbcodebuilder.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/cachingloaderdecorator.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/context.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/engine.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/exception.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/filter.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/filterexpression.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_templates_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_textdocument_export.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_version.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/markupdirector.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/mediawikimarkupbuilder.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/metatype.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/node.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/outputstream.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/parser.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/plaintextmarkupbuilder.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/qtlocalizer.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/rendercontext.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/safestring.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/taglibraryinterface.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/template.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/templateloader.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/texthtmlbuilder.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/token.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/typeaccessor.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/util.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/grantlee/variable.h delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/CMakeLists.txt delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_qt_msg_handler.inc delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_signal_handler.inc delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.cpp delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.h delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.cpp delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.h delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.cpp delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.h delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.cpp delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.h delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.cpp delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.h delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.cpp delete mode 100755 qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/poppler/qt5/poppler-qt5.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicBuffer.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicDataConverter.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/EntityId.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/ResourceIdentifier.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/SQLiteConnection.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/ServiceException.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/StringBuffer.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Connection.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Request.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/test/CivetWebSocketConnectionTester.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpException.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpUtils.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Method.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Response.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/StatusCode.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/WebSocketUtils.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/log/Log.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/CivetWebSocketConnection.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Connection.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Request.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/RequestHandler.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Server.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/ServerProperty.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/WebSocketConnection.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebHandler.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebSocketHandlerImpl.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/WebSocketHandler.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/log/LogConfig.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Counters.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Utils.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/test/SqliteVerifier.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestFramework.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestLogCapture.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/util/LockedBuffer.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Path.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Utils.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/apputils/util/VersionableComponent.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/cds/Logger.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/cds/PropertySet.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/cds/Service.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/cds/ServiceProperty.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/cds/detail/CloudDiscoveryServiceImpl.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/AggregationBuilders.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/Builder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/BuilderHelper.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/ExceptionHelper.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSample.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSampleImpl.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/FlatTypeTraits.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/Offset.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceBuilders.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceIterator.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceOffsets.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/flat/rtiflat.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoring.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoringPlugin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypes.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypesPlugin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdmin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdminPlugin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommon.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommonPlugin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/CollectorService.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Dll.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Log.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Logger.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/PropertySet.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Service.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/ServiceProperty.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/detail/CollectorServiceImpl.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/Logger.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/PropertySet.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/RecordingService.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/Service.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/ServiceProperty.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/StreamInfo.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/detail/RecordingServiceImpl.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/EStorageFormat.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/SelectorState.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDefs.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDiscoveryStreamWriter.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageReader.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamInfoReader.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamReader.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamWriter.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageWriter.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageReaderForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamInfoReaderForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamReaderForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamWriterForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageWriterForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/EntityListener.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/Logger.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/PropertySet.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/RoutingService.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/Service.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/ServiceProperty.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/StreamInfo.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/TypeInfo.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/UpdatableEntity.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/AdapterPlugin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Connection.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/DiscoveryStreamReader.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Session.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReader.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReaderListener.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamWriter.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/AdapterForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ConnectionForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/DiscoveryStreamReaderForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ReadProxy.h delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/SessionForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderListenerForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamWriterForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ForwarderUtils.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/detail/RoutingServiceImpl.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ShutdownHookForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/detail/UpdatableEntityForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/log/LogConfig.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Input.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSample.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSamples.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Output.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/PortIterator.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Processor.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/ProcessorPlugin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Query.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Route.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/SampleIterator.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorPluginForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/transf/Transformation.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/transf/TransformationPlugin.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationPluginForwarder.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/webdds/Dll.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/webdds/Service.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/webdds/ServiceProperty.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/webdds/detail/WebIntegrationServiceImpl.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/xcdr/Interpreter.hpp delete mode 100644 qt6-after/qt6-migrated-legatus/include/rti/xcdr/Stream.hpp diff --git a/qt6-after/qt6-migrated-legatus/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/CMakeLists.txt index fb0f5dc80..b9af1c384 100755 --- a/qt6-after/qt6-migrated-legatus/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/CMakeLists.txt @@ -154,7 +154,6 @@ include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore) # only that generated header, so appending it cannot shadow an existing include. include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsSettings) include_directories(${CMAKE_SOURCE_DIR}/Z/src/NGLLogger) -include_directories(${CMAKE_SOURCE_DIR}/include/Viewer/SituationMap) SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_CXX_STANDARD_REQUIRED ON) SET(CMAKE_VISIBILITY_INLINES_HIDDEN ON) diff --git a/qt6-after/qt6-migrated-legatus/Lts/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/CMakeLists.txt index 5e97296c8..125a53b30 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/CMakeLists.txt @@ -63,15 +63,9 @@ IF(NOT RELEASE_BUILD) INCLUDE(MacroCodeGenIdl) ENDIF() -# Add stub headers for non-RTI/non-FilterManagement builds -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/AudioVideoManagement/) +# Export headers included by bare name from module sources (release scope) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/NGLLogger/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsSession/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/TopicEditorBase/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/OperatorManagement/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsScriptTimeline/) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsUtilsGuiDds/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/Services/PresentationManagement/) IF(NOT RELEASE_BUILD) CODEGEN_WRITE_SERVICEFILE_INFO() diff --git a/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView.cpp b/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView.cpp deleted file mode 120000 index e088a4ab5..000000000 --- a/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView.cpp +++ /dev/null @@ -1 +0,0 @@ -zsksxd_tetraForLogView.x \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.cpp b/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.cpp deleted file mode 120000 index 22f709a79..000000000 --- a/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.cpp +++ /dev/null @@ -1 +0,0 @@ -zsksxd_tetraForLogView_guez.x \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.x b/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.x deleted file mode 100644 index 68d6bcee7..000000000 --- a/qt6-after/qt6-migrated-legatus/TetraIF/LogView/zsksxd_tetraForLogView_guez.x +++ /dev/null @@ -1,1839 +0,0 @@ -/* -const MAX_LAENGE_GEFECHTSFELDTELEGRAMM = 2000; -*/ - -/*-------------------------------*/ -/* Telegramm-ID's */ -/*-------------------------------*/ - -enum8 gef_telegramm_id_et { - - GEF_BESTAETIGUNG = 0, - - GEF_INIT = 1, - GEF_MANIPULATIONSMELDUNG = 2, - GEF_UMGEBUNGS_MELDUNG = 3, - GEF_UMGEBUNGS_MELDUNG2 = 203, - GEF_AUFFORDERUNG_BITE_MELDUNG = 4, - GEF_BITE_MELDUNG = 5, - GEF_BITE_MELDUNG2 = 205, - - GEF_LIZENSIERUNG_TNE = 6, - GEF_BETRIEBSZUSTAND_AUSSTATTUNG = 7, - GEF_KONFIGURATION_TEILNEHMER = 8, - GEF_KONFIGURATION_WIRKMODELL = 9, - GEF_ANFORDERUNG_KONFIGURATIONSDATEN = 10, - GEF_KONFIGURATIONSMELDUNG = 11, - GEF_FEHLERMELDUNG_GFD = 12, - - GEF_POSITIONS_MELDUNG = 21, - GEF_POSITIONS_MELDUNG_MIT_TEILNEHMER = 22, - GEF_POSITIONS_MELDUNG_LFZ = 23, - GEF_POSITIONSKORREKTURDATEN = 24, - - GEF_WIRKFELD_EINZELGESCHOSS = 31, - GEF_WIRKFELD_FLAECHENDECKENDES_FEUER = 32, - GEF_WIRKFELD_FLAECHENDECKENDES_FEUER_STOP = 33, - GEF_WIRKFELD_FLAECHENDECKENDES_FEUER_FORTSETZEN = 34, - GEF_WIRKFELD_MINENSPERRE = 35, - GEF_WIRKFELD_STATUS_MINENSPERRE = 36, - GEF_WIRKFELD_A_KAMPFMITTEL = 37, - GEF_WIRKFELD_C_KAMPFSTOFF = 38, - GEF_DEAKTIVIERUNG_WIRKFELD = 39, - GEF_WIRKFELD_AENDERUNG_BEZEICHNER = 40, - GEF_DEAKTIVIERUNG_EINZELMINE = 41, - GEF_REAKTIVIERUNG_DUS_MINE = 42, - GEF_DEFINITION_IED = 43, - GEF_ZUSTAND_IED = 44, - GEF_STATUS_EINZELMINENSIMULATOR = 45, - GEF_WIRKFELD_EINZELMINENSIMULATOR = 46, - - GEF_FEUER_EREIGNIS = 51, - GEF_TREFFER_EREIGNIS_DUS = 52, - GEF_TREFFER_EREIGNIS_WIRKSIMULATION = 53, - GEF_TREFFER_AUSLOESUNG = 54, - GEF_SCHIEDSRICHTEREINGRIFF = 55, - GEF_SELEKTIVE_AUFMUNITIONIERUNG = 56, - - GEF_TREFFER_EREIGNIS_DUS_IPS = 228, - GEF_TREFFER_EREIGNIS_WIRKSIMULATION_IPS = 229, - - GEF_TAKTISCHER_STATUS = 61, - GEF_FUNKTIONSRAUM = 62, - GEF_EINTRETEN_FUNKTIONSRAUM = 63, - GEF_DEAKTIVIEREN_FUNKTIONSRAUM = 64, - - GEF_DATENVERKEHR_SRT_TDS = 71, - GEF_DATENVERKEHR_TDS_SRT = 72, - GEF_DATENVERKEHR_DMF_TDS = 73, - GEF_DATENVERKEHR_TDS_DMF = 74, - - GEF_STEUERUNG_VERKEHRSAUFKOMMEN = 81, - GEF_NACHFORDERUNG_BROADCAST_TELEGRAMME = 82, - GEF_NOP = 83, - - GEF_SONDERSENSORIK_BETRIEBSZUSTAND = 91, - GEF_SONDERSENSORIK_FAHRSPUR = 92, - GEF_SONDERSENSORIK_DATEN = 93, - GEF_SONDERSENSORIK_TREFFER_AUFGES_TLN = 94, - GEF_SONDERSENSORIK_MIVANH_VERLEGEDATEN = 95, - GEF_SONDERSENSORIK_WMIV_VERLEGEDATEN = 96, - GEF_SONDERSENSORIK_MIVANH_VERLEGEPOSITION = 97, - - GEF_SPRACHAUSWAHL = 101, - GEF_ALLGEMEINE_NACHRICHT = 102, - GEF_ECHO_ON_OFF = 103, - GEF_ESW_MELDUNG = 104, - - GEF_WF_SAMMELDEAKTIVIERUNG = 105, - GEF_WF_SAMMELDEAKTIVIERUNG_DUS_MINEN = 106, - GEF_WF_SAMMELDEAKTIVIERUNG_FUNKTIONSRAUM = 107, - - GEF_DATENVERKEHR_GEOP_TDS = 181, - GEF_DATENVERKEHR_TDS_GEOP = 182, - - GEF_DATENVERKEHR_TGTS_TDS = 183, - GEF_DATENVERKEHR_TDS_TGTS = 184, - GEF_GERAETEEREIGNIS = 185, - - GEF_WAFFENZUORDNUNG = 200, - GEF_IPS_POSITIONSDATEN = 201, - GEF_STANDORTBESTIMMUNG = 25, - GEF_MUNITIONSVORRAT_EINER_ZUGEORDNETEN_WAFFE = 202, - GEF_FEUEREREIGNIS_MIT_WAFFENZUORDNUNG = 210, - GEF_AUSLOESUNG_DUS_TREFFER = 211, - GEF_ANFORDERUNG_SW_VERSION = 212, - GEF_SW_VERSIONSMELDUNG = 213, - - GEF_TREFFER_EREIGNIS_SEKUNDAERWIRKUNG = 218, - GEF_TECHNIK_FUNKTIONSRAUM = 219, - GEF_ANFORDERUNG_KONFIG_ZEG = 220, - GEF_KONFIGURATION_IPS = 221, - GEF_KONFIGURATION_ZEG = 222, - GEF_TREFFEREREIGNIS_SEKUNDAERWIRKUNG = 223, - GEF_TREFFEREREIGNIS_GEBAEUDE = 224, - - GEF_TEILNEHMERMODE_SETZEN = 230, - GEF_TEILNEHMERMODE_MELDUNG = 231, - GEF_TEILNEHMERMODE_ANFORDERN = 232, - GEF_TEILNEHMER_KONFIG_ANTWORT = 233, - GEF_TEILNEHMER_KONFIG_SETZEN = 234, - GEF_TEILNEHMER_KONFIG_ANFORDERN = 235, - - GEF_SANITAETSDIENST_INSTANDSETZUNG = 240, - GEF_BESTANDSMELDUNG_SANITAETSMATERIAL = 241, - GEF_SANITAETSDIENST_INSTANDSETZUNG_PVSAN = 242, - - GEF_GEFECHTSFELDTELEGRAMM = 300, - GEF_UEBERLAST_WARNUNG_ENTWARNUNG = 301, - GEF_DATENFUNK_INIT = 302, - GEF_DATENFUNK_EXIT = 303, - GEF_DATENFUNK_EXIT_ACKNOWLEDGE = 304, - GEF_ZUORDNUNG_GRUPPENRUFADRESSE = 305, - GEF_NOTRUF = 1120 -}; - - -/*==============================================================*/ -/* Strukturtypen, die mehrfach verwendet werden */ -/*==============================================================*/ - -/*---------------------------------------*/ -/* Identifikation */ -/*---------------------------------------*/ - -typedef UInt16 gef_ausstattungs_id_t; - - -/*---------------------------------------*/ -/* Header */ -/*---------------------------------------*/ - -struct gef_header_rt { - gef_ausstattungs_id_t identitaet; -}; - - -/*---------------------------------------*/ -/* GPS-Zeit */ -/*---------------------------------------*/ - -struct gef_gps_zeit_rt { - u_int GPS_zeit; -}; - - -/*---------------------------------------*/ -/* GPS-Position */ -/*---------------------------------------*/ - -struct gef_gps_position_rt { - SInt24 nordwert; - SInt24 ostwert; -}; - - -/*---------------------------------------*/ -/* Lastzustand Datenfunk */ -/*---------------------------------------*/ - -enum8 gef_lastzustand_datenfunk_et { - Normallast = 0, - Hochlast = 1, - Ueberlast = 2 -}; - - -/*==============================================================*/ -/* Beschreibung der speziellen TETRA-Telegramme */ -/*==============================================================*/ - -struct TETRA_register_indication_rt { - UInt32LE ISSI_ext_host; -}; - -enum8 TETRA_registration_status_et { - ISSI_successful_registered = 0, - Duplicate_ISSI = 1, - Invalid_ISSI = 2, - Invalid_IP_address = 3 -}; - -struct TETRA_register_response_rt { - TETRA_registration_status_et registration_status; -}; - -enum8 TETRA_login_status_et { - Login_Request = 1, - Login_Accept = 2, - Login_Reject = 3 -}; - -enum8 TETRA_login_mastering_et { - No_Mastering = 0, - Mastering = 1 -}; - -enum8 TETRA_reject_cause_et { - Reserved = 0, - EqIdAlreadyAssigned = 1, - IssiAlreadyAssigned = 2, - EqIdAssignedInOtherExercise = 3 -}; - -struct TETRA_login_telegram_rt { - gef_header_rt header; - TETRA_login_status_et:0..1 login_status; - TETRA_login_mastering_et:2..2 login_mastering; - TETRA_reject_cause_et:3..6! reject_cause; -}; - -enum8 TETRA_telegram_type_et { - NotFragmented = 0, - FirstFragment = 1, - MiddleFragment = 3, - LastFragment = 2 -}; - -enum8 TETRA_fragment_counter_et { - 0 = 0, - 1 = 1, - 2 = 2, - 3 = 3, - 4 = 4, - 5 = 5, - 6 = 6, - 7 = 7, - 8 = 8, - 9 = 9, - 10 = 10, - 11 = 11, - 12 = 12, - 13 = 13, - 14 = 14, - 15 = 15 -}; - -struct TETRA_first_fragment_rt { - TETRA_telegram_type_et:0..1 telegram_type; - TETRA_fragment_counter_et:4..7! fragment_counter; - gef_telegramm_id_et telegram_id; - opaque data<28>; /* 28 => dyn.-array-offset */ -}; - -struct TETRA_middle_fragment_rt { - TETRA_telegram_type_et:0..1 telegram_type; - TETRA_fragment_counter_et:4..7! fragment_counter; - opaque data<27>; /* 27 => dyn.-array-offset */ -}; - -struct TETRA_last_fragment_rt { - TETRA_telegram_type_et:0..1 telegram_type; - TETRA_fragment_counter_et:4..7! fragment_counter; - opaque data<27>; /* 27 => dyn.-array-offset */ -}; - -struct TETRA_air_interface_load_report_rt { - UInt8 network_index; - UInt16LE base_station_ID; - UInt8 channel_ID; - UInt8 queue_length; -}; - -struct TETRA_status_ind_req_rt { - UInt32LE ISSI_host; - UInt32LE ISSI_destination; - UInt32LE status; -}; - -enum8 TETRA_monitor_et { - No_Monitoring = 0, - Monitoring = 1 -}; - -struct TETRA_group_monitoring_ind_rt { - UInt32LE ISSI_host; - TETRA_monitor_et monitor; - UInt16LEIdx count_gssi; - UInt32LE gssi<5>; -}; - -struct TETRA_air_interface_load_req_rt { - UInt16LEIdx number_of_reports; - TETRA_air_interface_load_report_rt air_interface_load_report<4>; -}; - -struct TETRA_unknown_PDU_rt { - UInt8 magic_number; - UInt8 counter; - UInt16LE length; - UInt8 PDU_Type; - opaque data<5>; /* 5 => dyn.-array-offset */ -}; - - -/*==============================================================*/ -/* Beschreibung der Telegramme */ -/*==============================================================*/ - -/*----------------------------------------------------------------*/ -/* Automatische Conversion */ -/*----------------------------------------------------------------*/ -/* -Alle TETRA-Meldungen, die mit der Klasse CoPrtCnvTelegramConverter in -eine Zentral-Meldung konvertiert werden, müssen trotzdem in der TETRA- -union definiert werden, damit die Telegramme Namen bekommen. -*/ - -struct gef_automatic_conversion_rt { - gef_header_rt header; - UInt8 fehler_diese_meldung_sollte_automatisch_konvertiert_werden; -}; - - - -/*----------------------------------------------------------------*/ -/* Init-Meldung */ -/* INIT_MELDUNG */ -/*----------------------------------------------------------------*/ - -enum8 gef_tln_aufmunitionieren_et { - tln_am_nein = 0, - tln_am_ja = 1 -}; - -enum8 gef_tln_zuruecksetzen_et { - tln_zs_nein = 0, - tln_zs_ja = 1 -}; - -enum8 gef_tln_manipulation_et { - tln_mp_nein = 0, - tln_mp_reset = 1 -}; - -enum8 gef_tln_medizinische_vorraete_auffuellen_et { - tln_mv_nein = 0, - tln_mv_reset = 1 -}; - -/* MSB = 0 ... */ -struct gef_initialisierungsdaten_rt { - gef_tln_aufmunitionieren_et:2..2 tln_aufmunitionieren; - gef_tln_zuruecksetzen_et:1..1 tln_zuruecksetzen; - gef_tln_manipulation_et:7..7 tln_manipulation; - gef_tln_medizinische_vorraete_auffuellen_et:6..6 tln_mediziniesche_vorraete_auffuellen; -}; - -struct gef_init_meldung_rt { - gef_header_rt header; - gef_initialisierungsdaten_rt initialisierungsdaten; -}; - - -/*----------------------------------------------------------------*/ -/* Umgebungs-Meldung */ -/* UMGEBUNGS_MELDUNG */ -/*----------------------------------------------------------------*/ - - -enum8 gef_uebungspause_et { - KEINE_UEBUNGSPAUSE = 0, - B_MIT_TEST = 1 -}; - -enum8 gef_inhbit_time_et { - IH_UNDEFINED = 0, - IH_1_SEKUNDE = 1, - IH_2_SEKUNDEN = 2, - IH_3_SEKUNDEN = 3, - IH_4_SEKUNDEN = 4, - IH_5_SEKUNDEN = 5, - IH_6_SEKUNDEN = 6, - IH_7_SEKUNDEN = 7, - IH_8_SEKUNDEN = 8, - IH_9_SEKUNDEN = 9, - IH_10_SEKUNDEN = 10, - IH_11_SEKUNDEN = 11, - IH_12_SEKUNDEN = 12, - IH_13_SEKUNDEN = 13, - IH_14_SEKUNDEN = 14, - IH_15_SEKUNDEN = 15, - IH_16_SEKUNDEN = 16, - IH_17_SEKUNDEN = 17, - IH_18_SEKUNDEN = 18, - IH_19_SEKUNDEN = 19, - IH_20_SEKUNDEN = 20, - IH_21_SEKUNDEN = 21, - IH_22_SEKUNDEN = 22, - IH_23_SEKUNDEN = 23, - IH_24_SEKUNDEN = 24, - IH_25_SEKUNDEN = 25, - IH_26_SEKUNDEN = 26, - IH_27_SEKUNDEN = 27, - IH_28_SEKUNDEN = 28, - IH_29_SEKUNDEN = 29, - IH_30_SEKUNDEN = 30, - IH_31_SEKUNDEN = 31 -}; - -struct gef_betriebszustaende_gefechtsfeld_rt { - gef_uebungspause_et:0..0 uebungspause; - gef_inhbit_time_et:1..5 pos_inhibit_time; - gef_lastzustand_datenfunk_et:6..7! lastzustand_datenfunk; -}; - -struct gef_basiskoordinate_zur_positionsbestimmung_rt { - UInt8 zone; - string band; - string quadrat[2]; - UInt8 ostwert; - UInt8 nordwert; -}; - -struct gef_umgebungs_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - UInt16 uebungskennung; - UInt8 ruecksetzzaehler; - gef_betriebszustaende_gefechtsfeld_rt betriebszustaende_gefechtsfeld; - string zeitzone; - gef_basiskoordinate_zur_positionsbestimmung_rt basiskoordinate_zur_positionsbestimmung; -}; - -struct gef_umgebungs_meldung2_rt { - gef_header_rt header; - UInt16 broadcast_index; - UInt16 uebungskennung; - UInt8 ruecksetzzaehler; - gef_betriebszustaende_gefechtsfeld_rt betriebszustaende_gefechtsfeld; - string zeitzone; - gef_basiskoordinate_zur_positionsbestimmung_rt basiskoordinate_zur_positionsbestimmung; - gef_gps_zeit_rt aktuelle_zeit; -}; - - -/*----------------------------------------------------------------*/ -/* Aufforderung BITE-Meldung */ -/* AUFFORDERUNG_BITE_MELDUNG */ -/*----------------------------------------------------------------*/ - - -enum8 gef_bite_meldungsart_et { - NUR_STATUSABFRAGE = 0, - ERST_SELBSTTEST = 1 -}; - -struct gef_aufforderung_bite_meldung_rt { - gef_header_rt header; - gef_bite_meldungsart_et bite_meldungsart; -}; - -/*----------------------------------------------------------------*/ -/* Konfiguration Wirkmodell */ -/* GEF_KONFIGURATION_WIRKMODELL */ -/*----------------------------------------------------------------*/ - -struct gef_wirkmodell_rt { - UInt8 minen_ied; - UInt8 steilfeuer; - UInt8 einsatzmittel; - UInt8 ac_waffen; -}; - -struct gef_konfiguration_wirkmodell_rt { - gef_header_rt header; - gef_wirkmodell_rt wirkmodelle; -}; - -/*----------------------------------------------------------------*/ -/* Konfigurationsmeldung */ -/* GEF_KONFIGURATION_TEILNEHMER */ -/*----------------------------------------------------------------*/ - -struct gef_login_parameter_rt { - UInt8 wartezeit_versuche; - UInt8 anzahl_versuche; - UInt8 mastering_flag; -}; - -enum8 gef_sprache_et { - keine_aenderung = 0, - deutsch = 1, - englisch = 2, - franzoesisch = 3 -}; - -struct gef_konfiguration_abe_rt { - UInt8 sprachausgabe; - gef_sprache_et sprache; -}; - -struct gef_konfiguration_wirkdarstellung_rt { - UInt8 pyrotechnik; -}; - -enum8 gef_betriebsart_mhgr_sensorik_et { - BetriebAmAusbAusstgPers = 0, - BetriebAnSonstigenFzg = 2, - BetriebAnSrFahrzeug = 3 -}; - -struct gef_konfiguration_mhgr_sensorik_rt { - gef_betriebsart_mhgr_sensorik_et betriebsart; - UInt8 energiesparmodus; -}; - -enum8 gef_konfiguration_ss_fir_et { - keineKonfigurationFir = 0, - fir = 1, - firSpzMarder = 2 -}; - -enum8 gef_konfiguration_ss_minenverlegung_et { - keineKonfigurationMinenverlegung = 0, - MvAnh = 1, - Wmv = 2 -}; - -enum8 gef_konfiguration_ss_standard_et { - keineKonfigurationSsStandard = 0, - ZABC = 3, - CSF = 4, - PzBr = 5, - MRF = 7 -}; - -struct gef_konfiguration_sondersenoriken_rt { - gef_konfiguration_ss_fir_et fir; - gef_konfiguration_ss_minenverlegung_et minenverlegung; - gef_konfiguration_ss_standard_et standard; -}; - -enum8 gef_agdus_hw_modus_et { - ohneHelmOhneWeste = 1, - mitHelmOhneWeste = 2, - mitHelmMitWeste = 3 -}; - -enum8 gef_konfigurations_positionsupdate_et { - Fahrzeug = 0, - Person = 1, - Luftfahrzeug = 2 -}; - -struct gef_konfiguration_anzeige_rt { - UInt8 hauptgruppe; - UInt8 untergruppe; -}; - -struct gef_konfigurationsdaten_rt { - gef_ausstattungs_id_t identitaet; - UInt16 can_startup_zeit; - unsigned char teilnehmertyp; - gef_login_parameter_rt login_parameter; - UInt32LE can_geraete_konfiguration; - gef_konfiguration_abe_rt abe; - gef_konfiguration_wirkdarstellung_rt wirkdarstellung; - gef_konfiguration_mhgr_sensorik_rt mhgr_sensorik; - gef_konfiguration_sondersenoriken_rt sondersenrik; - gef_agdus_hw_modus_et agdus_hw_modus; - gef_konfigurations_positionsupdate_et positionsupdate; - gef_konfiguration_anzeige_rt anzeige; - UInt8 wirkmodellAgdus; -}; -% -struct gef_konfiguration_teilnehmer_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - gef_konfigurationsdaten_rt konfiguration; - gef_wirkmodell_rt wirkmodelle; -}; -/*----------------------------------------------------------------*/ -/* Lizensierung TNE-Meldung */ -/* LIZENSIERUNG_TNE_MELDUNG */ -/*----------------------------------------------------------------*/ - - -enum8 gef_lizenzierungsart_et { - ANMELDUNG_ERFOLGREICH = 0, - ANMELDUNG_ABGELEHNT = 1, - ABMELDUNG = 2 -}; - -struct gef_lizensierung_tne_meldung_rt { - gef_header_rt header; - gef_lizenzierungsart_et lizenzierungsart; - opaque fehlercode_lizenzierung[3]; -}; - -enum8 gef_qualifikation_et { - Undefiniert = 0, - Arzt = 1, - Sanitaeter = 2, - Ersthelfer = 3 -}; - -/*----------------------------------------------------------------*/ -/* Bestandsmeldung Saniätsmaterial */ -/* GEF_BESTANDSMELDUNG_SANITAETSMATERIAL */ -/*----------------------------------------------------------------*/ -struct gef_bestandmseldung_sanitatsmaterial_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - UInt16 id_behandelnder; - gef_qualifikation_et qualifikation; - UInt8 anzahl_sanmat; - UInt24 bestand_sanmaterialien; -}; - - -/*----------------------------------------------------------------*/ -/* SaniätsDienst Instandssetzung PVSAN */ -/* GEF_SANITAETSDIENST_INSTANDSETZUNG_PVSAN */ -/*----------------------------------------------------------------*/ -struct gef_sanitetsdienst_instandsetzung_pvsan_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - UInt16 massnahmen_getaetigt; - UInt16 id_behandelnder; - gef_qualifikation_et qualifikation; - UInt16 massnahmen_benoetigt; -}; - -/*----------------------------------------------------------------*/ -/* Technik Funktionsraum-Meldung */ -/* TECHNIK_FUNKTIONSRAUM */ -/*----------------------------------------------------------------*/ -struct gef_technik_funktionsraum_rt { - gef_header_rt header; - UInt16 broadcast_index; - UInt16 wirkfeldkennung; - UInt8 typ; - string wirkfeldbezeichner[8]; - gef_gps_position_rt zentrum; - UInt16 breite; - UInt16 hoehe; -}; - -/*----------------------------------------------------------------*/ -/* Wirkfeld Einzelgeschoss-Meldung */ -/* WIRKFELD_EINZELGESCHOSS_MELDUNG */ -/*----------------------------------------------------------------*/ - - -enum8 gef_munitionsart_steilfeuer_et { - STEILFEUER_AZ = 1, - STEILFEUER_HE_ANNZ = 2, - STEILFEUER_BOMBLET = 3, - STEILFEUER_SM_ART = 4, - STEILFEUER_NEBEL = 5, - MOERSER_AZ = 10, - MOERSER_ANNZ = 11, - BORDKANONE = 20, - UNGEL_RAKETE = 21, - BOMBLET = 22, - SPRENGBOMBE = 23 -}; -struct gef_beschreibung_wirkfeld_einzelgeschoss_rt { - UInt16 wirkfeldkennung; - string wirkfeldbezeichner[8]; - UInt8 partei_id; - gef_gps_zeit_rt wirkbeginn; - gef_gps_position_rt einschlagort; - UInt8 wirkdurchmesser; - gef_munitionsart_steilfeuer_et munitionsart; -}; - -struct gef_wirkfeld_einzelgeschoss_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_wirkfeld_einzelgeschoss_rt beschreibung_wirkfeld_einzelgeschoss; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld Flächendeckes Feuer-Meldung */ -/* WIRKFELD_FLAECHENDECKENDES_FEUER_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_beschreibung_wirkfeld_flaechendeckendes_feuer_rt { - UInt16 wirkfeldkennung; - string wirkfeldbezeichner[8]; - UInt8 partei_id; - gef_gps_zeit_rt wirkbeginn; - UInt16 wirkdauer; - gef_gps_position_rt wirkfeldeckpunkt; - UInt8 wirkfeldbreite; - UInt8 wirkfeldtiefe; - UInt16 drehwinkel_alt; - UInt8 mtpbreite; - UInt8 mtpdtiefe; - UInt16 drehwinkel; - UInt16 anzahl_einschlaege; - UInt16 wirkfeldradius; - gef_munitionsart_steilfeuer_et munitionsart; - UInt8 gefahrenabstand; - UInt8 gefahrenart; - gef_gps_position_rt mtp1; - gef_gps_position_rt mtp2; - gef_gps_position_rt mtp3; - gef_gps_position_rt mtp4; - -}; - -struct gef_wirkfeld_flaechendeckendes_feuer_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_wirkfeld_flaechendeckendes_feuer_rt beschreibung_wirkfeld_flaechendeckendes_feuer; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld Flächendeckes Feuer-Feuer Stop-Meldung */ -/* WIRKFELD_FLAECHENDECKENDES_FEUER_STOP_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_wirkfeld_flaechendeckendes_feuer_stop_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - UInt16 wirkfeldkennung; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld Flächendeckes Feuer-Feuer Fortsetzen-Meldung */ -/* WIRKFELD_FLAECHENDECKENDES_FEUER_FORTSETZEN_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_beschreibung_wirkfeld_flaechendeckendes_feuer_fortsetzen_rt { - UInt16 wirkfeldkennung; - UInt16 fortsetzungswert_zufallszahl; - UInt16 nummer_des_naechsten_einschags; - gef_gps_zeit_rt fortsetzungszeit; - UInt16 verbleibende_wirkdauer; -}; - -struct gef_wirkfeld_flaechendeckendes_feuer_fortsetzen_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_wirkfeld_flaechendeckendes_feuer_fortsetzen_rt beschreibung_wirkfeld_flaechendeckendes_feuer_fortsetzen; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld Minensperre-Meldung */ -/* WIRKFELD_MINENSPERRE_MELDUNG */ -/*----------------------------------------------------------------*/ - -enum8 gef_minentyp_et { - SchtzAbwMi_DUS = 211, - SchtzAbVMi_DUS = 212, - PzAbwVMi_DUS = 213, - SchtzAbwMi_virtuell = 214, - PzAbwVMi_virtuell = 215, - PzAbwWMi_virtuell = 216, - PzAbwRiMi_AGDUS = 60 -}; - -struct gef_segment_rt { - gef_gps_position_rt startpunkt; - gef_gps_position_rt endpunkt; -}; - -struct gef_beschreibung_wirkfeld_minensperre_rt { - UInt16 wirkfeldkennung; - string wirkfeldbezeichner[8]; - UInt8 partei_id; - gef_gps_zeit_rt wirkbeginn; - UInt8 wirkdauer; - gef_gps_position_rt wirkfeldeckpunkt; - UInt8 verlegetiefe; - UInt8 verlegedichte; - gef_minentyp_et minentyp; - UInt16 minenanzahl; - UInt8Idx anzahl_segmente; - gef_segment_rt segment<5>; -}; - -struct gef_wirkfeld_minensperre_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_wirkfeld_minensperre_rt beschreibung_wirkfeld_minensperre; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld Status Minensperre-Meldung */ -/* WIRKFELD_STATUS_MINENSPERRE_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_beschreibung_minenstatus_rt { - UInt16 wirkfeldkennung; - UInt16IdxDiv8 anzahl_minen; - opaque minenstatus<150>; -}; - -struct gef_wirkfeld_status_minensperre_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_minenstatus_rt beschreibung_minenstatus; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld A-Kampfmittel-Meldung */ -/* WIRKFELD_A_KAMPFMITTEL_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_beschreibung_wirkfeld_a_kampfmittel_rt { - UInt16 wirkfeldkennung; - string wirkfeldbezeichner[8]; - UInt8 partei_id; - gef_gps_zeit_rt wirkbeginn; - UInt16 wirkdauer; - gef_gps_position_rt einschlagort; - UInt16 radius; - UInt16 kantenlaenge_bereich_1; - UInt16 kantenlaenge_bereich_2; - UInt16 oeffnungswinkel; - UInt16 drehwinkel; -}; - -struct gef_wirkfeld_a_kampfmittel_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_wirkfeld_a_kampfmittel_rt beschreibung_wirkfeld_a_kampfmittel; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld C-Kampfstoff-Meldung */ -/* WIRKFELD_C_KAMPFSTOFF_MELDUNG */ -/*----------------------------------------------------------------*/ - -enum8 gef_kampfstofftyp_et { - fluechtig = 1, - sesshaft = 2 -}; - -struct gef_beschreibung_wirkfeld_c_kampfstoff_rt { - UInt16 wirkfeldkennung; - string wirkfeldbezeichner[8]; - UInt8 partei_id; - gef_gps_zeit_rt wirkbeginn; - UInt8 wirkdauer; - gef_gps_position_rt einschlagort; - UInt16 radius; - UInt8 vergroesserungsfaktor; - UInt16 windrichtung; - UInt8 windgeschwindigkeit; - gef_gps_zeit_rt gueltigkeitszeitpunkt_wetterdaten; - gef_gps_position_rt position_gueltigkeitszeitpunkt_wetterdaten;; - UInt8 kampfstoffkennung; - gef_kampfstofftyp_et kampfstofftyp; -}; - -struct gef_wirkfeld_c_kampfstoff_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_wirkfeld_c_kampfstoff_rt beschreibung_wirkfeld_c_kampfstoff; -}; - - - -/*----------------------------------------------------------------*/ -/* Deaktivierung-Wirkfeld-Meldung */ -/* DEAKTIVIERUNG_WIRKFELD_MELDUNG */ -/*----------------------------------------------------------------*/ - -enum8 gef_wirkfeldtyp_et { - Undefined = 0, - Minensperre = 1, - Steilfeuer_Flaeche = 2, - Steilfeuer_Einzel = 3, - A_Waffe = 4, - C_Waffe = 5, - Funktionsraum = 6, - TechnicalArea = 7, - DusSingleMineSimulator = 8, - GasPipeDetonation = 9, - SpecialArea = 10, - BeStillWarning = 11, - DangerZoneExplosion = 12, - AirSupport = 13 -}; - -struct gef_deaktivierung_wirkfeld_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_wirkfeldtyp_et wirkfeldtyp; - UInt16 wirkfeldkennung; -}; - - - -/*----------------------------------------------------------------*/ -/* Wirkfeld Aenderung Bezeichner-Meldung */ -/* WIRKFELD_AENDERUNG_BEZEICHNER_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_wirkfeld_aenderung_bezeichner_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_wirkfeldtyp_et wirkfeldtyp; - UInt16 wirkfeldkennung; - string wirkfeldbezeichner[8]; -}; - - - -/*----------------------------------------------------------------*/ -/* Deaktivierung Einzelmine-Meldung */ -/* DEAKTIVIERUNG_EINZELMINE_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_deaktivierung_einzelmine_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_gps_zeit_rt GPS_Zeit; - UInt16 wirkfeldkennung; - UInt16 minenindex; -}; - - - -/*----------------------------------------------------------------*/ -/* Reaktivierung DUS Mine-Meldung */ -/* REAKTIVIERUNG_DUS_MINE_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_dus_minenkennungen_rt { - UInt16Idx anzahl_DUS_Minen; - UInt16 kennung_DUS_Mine<500>; -}; - -struct gef_reaktivierung_dus_mine_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_dus_minenkennungen_rt DUS_minenkennungen; -}; - -/*----------------------------------------------------------------*/ -/* Definition-IED */ -/* DEFINITION_IED */ -/*----------------------------------------------------------------*/ - -enum8 gef_ied_typ_et { - S_IED = 1, - IED_innen = 2, - IED_aussen = 3 -}; - -enum8 gef_ied_kopplungsstatus_et { - IED_keine_Kopplung = 1, - IED_Kopplung_an_Tln = 2, - IED_Kopplung_an_IPS = 3 -}; - -enum8 gef_ied_takitscher_zustand_et { - IED_inaktiv = 0, /* verlegt und gesichert */ - IED_aktiv = 1, /* scharf */ - IED_geloescht = 2, /* entschaerft */ - IED_ausgeloest_Schalter = 3, - IED_ausgeloest_Fernbedienung = 4, - IED_ausgeloest_Lichtschranke = 5, - IED_ausgeloest_Zugdraht = 6, - IED_ausgeloest_Kontrollgeraet = 7, - IED_unbekannt = 255 /* Kontakt verloren */ -}; - -struct gef_definition_ied_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - UInt16 kennung; - gef_ied_typ_et typ; - UInt8 ausloeser; - UInt8 sprengkraft; - gef_gps_position_rt gps_position; - UInt8 partei_id; - gef_ied_kopplungsstatus_et kopplungsstatus; - gef_ausstattungs_id_t gekoppelte_id; - gef_ied_takitscher_zustand_et taktischer_zustand; /* 0 inaktiv, 1 aktiv */ - UInt8 pyrotechnik; /* 0 keine Pyro, 1 mit Pyro */ -}; - -/*----------------------------------------------------------------*/ -/* Zustand-IED */ -/* ZUSTAND_IED */ -/*----------------------------------------------------------------*/ - -enum8 gef_ied_fehler_et { - IED_kein_Fehler = 0, - IED_Kommunikations_Fehler = 1 -}; - -struct gef_zustand_ied_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - UInt16 kennung; - gef_ied_takitscher_zustand_et taktischer_zustand; - UInt8 pyrotechnik; /* 0 keine Pyro, 1 mit Pyro */ - UInt8 batteriewarnung; /* Bitleiste */ - gef_ied_fehler_et fehler_status_elektronik; - gef_ied_fehler_et fehler_status_pyrotechnik1; - gef_ied_fehler_et fehler_status_pyrotechnik2; - gef_ied_fehler_et fehler_status_pyrotechnik3; -}; - - -/*----------------------------------------------------------------*/ -/* Treffer Ausloesung-Meldung */ -/* TREFFER_AUSLOESUNG_MELDUNG */ -/*----------------------------------------------------------------*/ - -enum8 gef_verwundung_beschaedigung_et { - Einsatzbereit = 0, - Leichter_Treffer = 1, - Mittlerer_Treffer = 2, - Schwerer_Treffer = 3, - Bewegungsunfaehig = 4, - Bewegungsunfaehig_sichtbar = 5, - Ausfall_Waffenanlage = 6, - Ausfall_Waffenanlage_sichtbar = 7, - Totalausfall_sichtbar = 8, - Zeitlicher_Ausfall = 9, - Annaehernder_Treffer = 10, - Treffer_ohne_Wirkung = 11 -}; - -struct gef_treffer_ausloesung_meldung_rt { - gef_header_rt header; - gef_gps_zeit_rt GPS_zeit; - gef_verwundung_beschaedigung_et verwundung_beschaedigung; -}; - -/*----------------------------------------------------------------*/ -/* Status Einzelminensimulator */ -/* STATUS_EINZELMINENSIMULATOR */ -/*----------------------------------------------------------------*/ - -struct gef_status_einzelminensimulator_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - UInt16 minenkennung; - gef_gps_position_rt gps_position; - UInt8 minentyp; - UInt8 status; -}; - -/*----------------------------------------------------------------*/ -/* Wirkfeld Einzelminensimulator */ -/* WIRKFELD_EINZELMINENSIMULATOR */ -/*----------------------------------------------------------------*/ - -struct gef_beschreibung_einzelminensimulator_rt { - UInt16 wirkfeldkennung; - UInt8 partei_id; - UInt16 minenkennung; - gef_gps_zeit_rt wirkbeginn; - gef_gps_position_rt minenposition; - UInt8 minentyp; -}; - -struct gef_wirkfeld_einzelminensimulator_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_einzelminensimulator_rt beschreibung_einzelminensimulator; -}; - -/*----------------------------------------------------------------*/ -/* Schiedsrichtereingriff */ -/* SCHIEDSRICHTEREINGRIFF */ -/*----------------------------------------------------------------*/ -/* -struct gef_schiedsrichtereingriff_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - gef_gps_position_rt gps_position; - UInt16 schiedsrichter_aktion; - UInt8 schiedsrichter; -}; - - - -/*----------------------------------------------------------------*/ -/* Selektive Aufmunitionierung */ -/* GEF_SELEKTIVE_AUFMUNITIONIERUNG */ -/*----------------------------------------------------------------*/ -struct gef_aufmunitionierung_rt { - UInt16 munitionsart; - UInt8 ort; /* Turm / Wanne */ - UInt16 neuer_vorrat; /* 0xffff = default, 0xfffe = unveraendert lassen, 0xfffd = unbegrenzt */ - UInt16 neuer_default_vorrat; /* 0xffff = factory default, 0xfffe = unveraendert lassen, 0xfffd = unbegrenzt */ - UInt8 tracer_ratio; /* 0 = kein Trace, 1 = jedes Projektil, 2 = jedes 2. Projektil, ... */ -}; - -struct gef_selektive_aufmunitionierung_rt { - gef_header_rt header; - u_int waffen_id; - UInt8Idx anzahl_aufmunitionierungen; - gef_aufmunitionierung_rt aufmunitionierung<10>; -}; - -/*----------------------------------------------------------------*/ -/* SaniätsDienst Instandssetzung */ -/* GEF_SANITAETSDIENST_INSTANDSETZUNG */ -/*----------------------------------------------------------------*/ - -enum8 gef_behandlungs_ergebnis_et { - Keine = 0, - Erfolg = 1, - Stabilisiert = 2, - Fehler = 3 -}; - -struct gef_sanitetsdienst_instandsetzung_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - UInt8 verurschaer_typ; - UInt16 ausstattung_behandelnder; - gef_verwundung_beschaedigung_et status_start; - UInt8 typ_der_behandlung; - UInt8 triage; - UInt8 typ_der_behandlung; - gef_verwundung_beschaedigung_et status_ergebnis; - gef_behandlungs_ergebnis_et ergebhnis_behandlung; - UInt8 triage_priorität; - UInt8 komplett_status; - UInt24 behandlungszeit; - UInt24 erholungszeit; -}; - - - -*/ -/*----------------------------------------------------------------*/ -/* Funktionsraum-Meldung */ -/* FUNKTIONSRAUM_MELDUNG */ -/*----------------------------------------------------------------*/ - -enum8 gef_betriebsmodus_et { - Nicht_vorhanden = 0, - Eingriff_durch_schiedsrichter = 1, - Wartezeit_nach_Erreichen_des_Funktionsraums = 2 -}; - -struct gef_funktionsraum_rt { - gef_betriebsmodus_et betriebsmodus; - UInt8 wartezeit; -}; - -struct gef_beschreibung_funktionsraum_rt { - UInt16 funktionsraumkennung; - string funktionsraumbezeichner[8]; - UInt8 partei_id; - gef_gps_position_rt funktionsraumeckpunkt; - UInt8 funktionsraumbreite; - UInt8 funktionsraumtiefe; - gef_funktionsraum_rt funktionsraum_fuer_entgiftungsmassnahmen; - gef_funktionsraum_rt funktionsraum_fuer_instandsetzungsmassnahmen; - gef_funktionsraum_rt funktionsraum_fuer_sandienstliche_versorgung; -}; - -struct gef_funktionsraum_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_beschreibung_funktionsraum_rt beschreibung_funktionsraum; -}; - - - -/*----------------------------------------------------------------*/ -/* Funktionsraum-Meldung */ -/* FUNKTIONSRAUM_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_deaktivieren_funktionsraum_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - UInt16 funktionsraumkennung; -}; - - - -/*----------------------------------------------------------------*/ -/* Datenverkehr TDS-SRT-Meldung */ -/* DATENVERKEHR_TDS_SRT_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_fuer_tne_transparente_daten_rt { - opaque data<30>; /* 30 => dyn.-array-offset */ -}; - -struct gef_datenverkehr_tds_srt_meldung_rt { - gef_header_rt header; - gef_fuer_tne_transparente_daten_rt fuer_TNE_transparente_daten; -}; - - - -/*----------------------------------------------------------------*/ -/* Datenverkehr TDS-DMF-Meldung */ -/* DATENVERKEHR_TDS_DMF_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_datenverkehr_tds_dmf_meldung_rt { - gef_header_rt header; - gef_fuer_tne_transparente_daten_rt fuer_TNE_transparente_daten; -}; - - - -/*----------------------------------------------------------------*/ -/* Steuerung Verkehrsaufkommen-Meldung */ -/* STEUERUNG_VERKEHRSAUFKOMMEN_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_steuerung_verkehrsaufkommen_meldung_rt { - gef_header_rt header; - gef_lastzustand_datenfunk_et lastzustand_datenfunk; - UInt16 inhibit_zeit_fuer_positionsmeldungen; -}; - - - -/*----------------------------------------------------------------*/ -/* Nachforderung Broadcast Telegramme-Meldung */ -/* NACHFORDERUNG_BROADCAST_TELEGRAMME_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_nachforderung_broadcast_telegramme_meldung_rt { - gef_header_rt header; - gef_gps_zeit_rt GPS_zeit; - UInt8 ruecksetzzaehler; - UInt16 broadcast_index; -}; - - - -/*----------------------------------------------------------------*/ -/* Nop-Meldung */ -/* NOP_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_broadcasttelegramme_rt { - UInt16 feld_anfang; - UInt16 feld_ende; -}; - -struct gef_nop_meldung_rt { - gef_header_rt header; - gef_broadcasttelegramme_rt broadcasttelegramme; -}; - - - -/*----------------------------------------------------------------*/ -/* Sprachauswahl-Meldung */ -/* SPRACHAUSWAHL_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_sprachauswahl_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_sprache_et sprachauswahl; -}; - - - -/*----------------------------------------------------------------*/ -/* Allgemeine Nachricht-Meldung */ -/* ALLGEMEINE_NACHRICHT_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_nachricht_rt { - UInt8Idx laenge; - string text<80>; -}; - -struct gef_allgemeine_nachricht_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_nachricht_rt nachricht; -}; - - - -/*----------------------------------------------------------------*/ -/* Sammeldeaktivierung Wirkfeld-Meldung */ -/* SAMMELDEAKTIVIERUNG_WIRKFELD_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_liste_wirkfeldkennungen_rt { - UInt8Idx anzahl_kennungen; - UInt16 wirkfeldkennung<100>; -}; - -struct gef_wf_sammeldeaktivierung_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_liste_wirkfeldkennungen_rt liste_der_wirkfeldkennungen; -}; - - - -/*----------------------------------------------------------------*/ -/* Sammeldeaktivierung DUS-Minen-Meldung */ -/* SAMMELDEAKTIVIERUNG_DUS_MINEN_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_liste_dus_minenkennungen_rt { - UInt16Idx anzahl_DUS_minen; - UInt16 kennung_DUS_Mine<500>; -}; - -struct gef_wf_sammeldeaktivierung_dus_minen_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_liste_dus_minenkennungen_rt liste_DUS_minenkennungen; -}; - - - -/*----------------------------------------------------------------*/ -/* Sammeldeaktivierung Funktionsraum-Meldung */ -/* SAMMELDEAKTIVIERUNG_FUNKTIONSRAUM_MELDUNG */ -/*----------------------------------------------------------------*/ - -struct gef_liste_funktionsraumkennungen_rt { - UInt8Idx anzahl_kennungen; - UInt16 funktionsraumkennung<100>; -}; - -struct gef_wf_sammeldeaktivierung_funktionsraum_meldung_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_liste_funktionsraumkennungen_rt liste_der_funktionsraumkennungen; -}; - - -/*----------------------------------------------------------------*/ -/* Datenverkehr TDS-GeoP-Meldung */ -/* DATENVERKEHR_TDS_GEOP_MELDUNG */ -/*----------------------------------------------------------------*/ -struct gef_geop_daten_rt { - opaque data<31>; /* 31 => dyn.-array-offset */ -}; - -struct gef_datenverkehr_tds_geop_meldung_rt { - gef_header_rt header; - UInt8 laenge_GeoP_Daten; - gef_geop_daten_rt geop_daten; -}; - - -/*----------------------------------------------------------------*/ -/* Datenverkehr TDS-TgtS-Meldung */ -/* DATENVERKEHR_TDS_TGTS_MELDUNG */ -/*----------------------------------------------------------------*/ -struct gef_tgts_daten_rt { - opaque data<31>; /* 31 => dyn.-array-offset */ -}; - -struct gef_datenverkehr_tds_tgts_meldung_rt { - gef_header_rt header; - UInt8 laenge_tgts_Daten; - gef_tgts_daten_rt tgts_daten; -}; - -/*----------------------------------------------------------------*/ -/* Konfiguration IPS-Meldung */ -/* KONFIGURATION_IPS_MELDUNG */ -/*----------------------------------------------------------------*/ -struct gef_zuordnung_rt { - UInt16 raumnummer_des_gebaeudemodell; - UInt16 IPS_Platz_des_gebaeudemodell; - UInt16 IPS_Kennung; -}; - -struct gef_ips_konfiguration_rt { - UInt8Idx anzahl; - gef_zuordnung_rt zuordnung<255>; -}; - -struct gef_konfiguration_ips_meldung_rt { - gef_header_rt header; - UInt16 gebaeudemodell; - gef_ips_konfiguration_rt ips_konfiguration; -}; - -/*----------------------------------------------------------------*/ -/* GEF_TREFFER_EREIGNIS_SEKUNDAERWIRKUNG */ -/*----------------------------------------------------------------*/ -struct gef_treffer_ereignis_sekundaerwirkung_rt { - gef_header_rt header; - gef_gps_zeit_rt wirkbeginn; - UInt16 munCode; - UInt16 verursacher; - gef_wirkfeldtyp_et wirkfeldtyp; - UInt8 effectCode; - UInt16 minenIndex; - UInt16 unused; -}; - -/*----------------------------------------------------------------*/ -/* Konfiguration ZEG-Meldung */ -/* KONFIGURATION_ZEG_MELDUNG */ -/*----------------------------------------------------------------*/ -struct gef_zeg_zuordnung_rt { - UInt16 referenzmodul_des_gebaeudemodell; - UInt16 ZEG_Kennung; -}; - -struct gef_zeg_konfiguration_rt { - UInt8Idx anzahl; - gef_zeg_zuordnung_rt zeg_zuordnung<255>; -}; - -struct gef_konfiguration_zeg_meldung_rt { - gef_header_rt header; - UInt16 gebaeudemodell; - gef_zeg_konfiguration_rt zeg_konfiguration; -}; - -/*----------------------------------------------------------------*/ -/* Ausloseung DUS-Treffer */ -/* GEF_AUSLOESUNG_DUS_TREFFER */ -/*----------------------------------------------------------------*/ -struct gef_ausloesung_dus_treffer_rt { - gef_header_rt header; - gef_gps_zeit_rt zeit; - UInt8Idx munitionsart; - UInt16 richtung; - UInt16 entfernung; - UInt8Idx wirkung; - UInt16 verursacher; -}; -/*----------------------------------------------------------------*/ -/* GEF_ANFORDERUNG_SW_VERSION */ -/* GEF_SW_VERSIONSMELDUNG */ -/*----------------------------------------------------------------*/ -struct gef_anforderung_sw_version_rt { - gef_header_rt header; - UInt16 geraetekennung; -}; -/*----------------------------------------------------------*/ -/* TEILNEHMERMODE_SETZEN (Zentrale -> SFM) */ -/*----------------------------------------------------------*/ -enum8 gef_tln_sprache_et { - TLN_SPRACHE_KEINE_AENDERUNG = 0, - TLN_SPRACHE_DE = 1, - TLN_SPRACHE_EN = 2, - TLN_SPRACHE_FR = 3, - TLN_SPRACHE_AR = 4, - TLN_SPRACHE_ES = 5, - TLN_SPRACHE_RU = 6 -}; - -enum8 gef_operation_mode_et { - OP_MODE_KEINE_AENDERUNG = 0, - OP_MODE_NORMAL = 1, - OP_MODE_BE_STILL = 2 -}; - -enum8 gef_wph_mode_weste_et { - WPH_MODE_WESTE_KEINE_AENDERUNG = 0, - WPH_MODE_WESTE_OHNE = 1, - WPH_MODE_WESTE_MIT = 2 -}; - -enum8 gef_wph_mode_helm_et { - WPH_MODE_HELM_KEINE_AENDERUNG = 0, - WPH_MODE_HELM_OHNE = 1, - WPH_MODE_HELM_MIT = 2 -}; - -enum8 gef_wph_mode_personenschutz_et { - WPH_MODE_PERSONENSCHUTZ_KEINE_AENDERUNG = 0, - WPH_MODE_PERSONENSCHUTZ_OHNE = 1, - WPH_MODE_PERSONENSCHUTZ_ANZUG = 2, - WPH_MODE_PERSONENSCHUTZ_ANZUG_HANDSCHUHE_SCHUHE = 3 -}; - -enum8 gef_schutzniveau_et { - SN_SCHUTZ_KEINE_AENDERUNG = 0, - SN_IDZ_ES = 1, - SN_IDZ_BS = 2, - SN_KSK = 3, - SN_SOLDAT_MIT_KOERPERSCHUTZ = 4, - SN_SOLDAT_DARSTELLER = 5 -}; - -enum8 gef_handgranaten_suche_et { - HS_KEINE_AENDERUNG = 0, - HS_SUCHE_AUS = 1, - HS_SUCHE_EIN = 2 -}; - -enum8 gef_international_mode_et { - IM_KEINE_AENDERUNG = 0, - IM_AUS = 1, - IM_EIN = 2 -}; - -/* Reaktivierung: in Minuten (0, 10 .. 2550) */ -struct gef_teilnehmermode_rt { - gef_tln_sprache_et sprache; - gef_operation_mode_et op_mode; - UInt8 reaktivierung_entgiftung; - UInt8 reaktivierung_inst; - UInt8 reaktivierung_sanitaet; - gef_wph_mode_personenschutz_et:1..3 mode_personenschutz; - gef_wph_mode_weste_et:4..5 mode_weste; - gef_wph_mode_helm_et:6..7! mode_helm; - gef_schutzniveau_et schutzniveau; - gef_handgranaten_suche_et:6..7! handgranaten_suche; - gef_international_mode_et:4..5 international_mode; -}; - -struct gef_teilnehmermode_setzen_rt { - gef_header_rt header; - UInt16 bcIndex; - gef_teilnehmermode_rt mode; -}; -/*----------------------------------------------------------*/ -/* TEILNEHMERMODE_MELDUNG (SFM -> Zentrale) */ -/*----------------------------------------------------------*/ -struct gef_teilnehmermode_meldung_rt { - gef_header_rt header; - gef_gps_zeit_rt gps_zeit; - gef_teilnehmermode_rt mode; -}; - -/*----------------------------------------------------------------*/ -/* GEF_TEILNEHMER_KONFIG_SETZEN */ -/*----------------------------------------------------------------*/ - -enum8 gef_positions_handling_et { - POS_HANDLING_DEFAULT = 0, - POS_HANDLING_UNGUELTIG_NICHT_SCHICKEN = 1, - POS_HANDLING_UNGUELTIG_KENNZEICHNEN = 2, - POS_HANDLING_UNGUELTIG_SCHICKEN = 3 -}; - -enum8 gef_optischer_code_et { - OPTISCHER_CODE_KEINE_AENDERUNG = 0, - OPTISCHER_CODE_OSAG_1_0 = 1, - OPTISCHER_CODE_OSAG_2_0_BASIC = 2 -}; - -struct gef_sfm_konfig_rt { - UInt16 pos_aenderung_fz; - UInt16 pos_aenderung_personal; - UInt16 pos_aenderung_lfz; - UInt16 pos_uebertragungs_interval; - UInt16 hoehengrenze; - gef_positions_handling_et:6..7 positions_handling; - UInt8Idx:0..1! pos_interval_umschaltung; - UInt16 wartezeit_nachforderung; - UInt8 faktor_wartezeit_hochlast; - UInt8 wartezeit_vbg_1_2; - UInt8 wartezeit_vbg_2_3; - UInt8 wartezeit_vbg_3_8; - gef_optischer_code_et optischer_code; - UInt8 verwundungsmodel; - UInt8 gueltigkeitsdauer_standortbestimmung; -}; - -struct gef_teilnehmer_konfig_setzen_rt { - gef_header_rt header; - UInt16 broadcast_index; - gef_sfm_konfig_rt konfig; -}; - -/*----------------------------------------------------------------*/ -/* GEF_TEILNEHMER_KONFIG_ANTWORT */ -/*----------------------------------------------------------------*/ - -struct gef_teilnehmer_konfig_antwort_rt { - gef_header_rt header; - gef_gps_zeit_rt GPS_zeit; - gef_sfm_konfig_rt konfig; -}; - -/*-------------------------------------------------------*/ -/* GEF_NOTRUF */ -/*-------------------------------------------------------*/ - -struct gef_notruf_rt { - gef_gps_position_rt gps_position; -}; - -/*==============================================================*/ -/* Zusammenfassung der Telegramm-Typen */ -/*==============================================================*/ -union gef_tg_nd_ switch (gef_telegramm_id_et telegramm_id) { - - case GEF_INIT: - gef_init_meldung_rt init_meldung; - - case GEF_MANIPULATIONSMELDUNG: - case GEF_BITE_MELDUNG: - case GEF_BITE_MELDUNG2: - case GEF_BETRIEBSZUSTAND_AUSSTATTUNG: - case GEF_ANFORDERUNG_KONFIGURATIONSDATEN: - case GEF_FEHLERMELDUNG_GFD: - case GEF_POSITIONS_MELDUNG: - case GEF_POSITIONS_MELDUNG_MIT_TEILNEHMER: - case GEF_POSITIONS_MELDUNG_LFZ: - case GEF_FEUER_EREIGNIS: - case GEF_TREFFER_EREIGNIS_DUS: - case GEF_TREFFER_EREIGNIS_WIRKSIMULATION: - case GEF_FEUEREREIGNIS_MIT_WAFFENZUORDNUNG: - case GEF_TAKTISCHER_STATUS: - case GEF_TREFFER_EREIGNIS_DUS_IPS: - case GEF_TREFFER_EREIGNIS_WIRKSIMULATION_IPS: - case GEF_EINTRETEN_FUNKTIONSRAUM: - case GEF_DATENVERKEHR_SRT_TDS: - case GEF_DATENVERKEHR_DMF_TDS: - case GEF_SONDERSENSORIK_BETRIEBSZUSTAND: - case GEF_SONDERSENSORIK_FAHRSPUR: - case GEF_SONDERSENSORIK_DATEN: - case GEF_SONDERSENSORIK_MIVANH_VERLEGEDATEN: - case GEF_SONDERSENSORIK_WMIV_VERLEGEDATEN: - case GEF_SONDERSENSORIK_MIVANH_VERLEGEPOSITION: - case GEF_DATENVERKEHR_GEOP_TDS: - case GEF_DATENVERKEHR_TGTS_TDS: - case GEF_GERAETEEREIGNIS: - case GEF_WAFFENZUORDNUNG: - case GEF_IPS_POSITIONSDATEN: - case GEF_STANDORTBESTIMMUNG: - case GEF_MUNITIONSVORRAT_EINER_ZUGEORDNETEN_WAFFE: - case GEF_ANFORDERUNG_KONFIG_ZEG: - case GEF_TREFFEREREIGNIS_SEKUNDAERWIRKUNG: - case GEF_TREFFEREREIGNIS_GEBAEUDE: - case GEF_TEILNEHMERMODE_ANFORDERN: - case GEF_TEILNEHMER_KONFIG_ANFORDERN: - case GEF_SCHIEDSRICHTEREINGRIFF: - gef_automatic_conversion_rt manipulations_meldung; - - case GEF_SELEKTIVE_AUFMUNITIONIERUNG: - gef_selektive_aufmunitionierung_rt selektive_aufmunitionierung; - - case GEF_SANITAETSDIENST_INSTANDSETZUNG: - gef_sanitetsdienst_instandsetzung_rt sanitetsdienst_instandsetzung; - case GEF_BESTANDSMELDUNG_SANITAETSMATERIAL: - gef_bestandmseldung_sanitatsmaterial_rt bestandmseldung_sanitatsmaterial; - case GEF_SANITAETSDIENST_INSTANDSETZUNG_PVSAN: - gef_sanitetsdienst_instandsetzung_pvsan_rt sanitetsdienst_instandsetzung_pvsan; - case GEF_TECHNIK_FUNKTIONSRAUM: - gef_technik_funktionsraum_rt technik_funktionsraum; - case GEF_UMGEBUNGS_MELDUNG: - gef_umgebungs_meldung_rt umgebungs_meldung; - - case GEF_UMGEBUNGS_MELDUNG2: - gef_umgebungs_meldung2_rt umgebungs_meldung2; - - case GEF_AUFFORDERUNG_BITE_MELDUNG: - gef_aufforderung_bite_meldung_rt aufforderung_bite_meldung; - - case GEF_LIZENSIERUNG_TNE: - gef_lizensierung_tne_meldung_rt linzensierung_tne_meldung; - - case GEF_KONFIGURATION_TEILNEHMER: - gef_konfiguration_teilnehmer_rt konfiguration_teilnehmer; - - case GEF_KONFIGURATION_WIRKMODELL: - gef_konfiguration_wirkmodell_rt konfiguration_wirkmodell; - - case GEF_TEILNEHMERMODE_SETZEN: - gef_teilnehmermode_setzen_rt teilnehmermode_setzen; - - case GEF_TEILNEHMERMODE_MELDUNG: - gef_teilnehmermode_meldung_rt teilnehmermode_meldung; - - case GEF_TEILNEHMER_KONFIG_SETZEN: - gef_teilnehmer_konfig_setzen_rt teilnehmer_konfig_setzen; - - case GEF_TEILNEHMER_KONFIG_ANTWORT: - gef_teilnehmer_konfig_antwort_rt teilnhemer_konfig_antwort; - -/* case GEF_POSITIONSKORREKTURDATEN: - */ - - case GEF_WIRKFELD_EINZELGESCHOSS: - gef_wirkfeld_einzelgeschoss_meldung_rt wirkfeld_einzelgeschoss_meldung; - - case GEF_WIRKFELD_FLAECHENDECKENDES_FEUER: - gef_wirkfeld_flaechendeckendes_feuer_meldung_rt wirkfeld_flaechendeckendes_feuer_meldung; - - case GEF_WIRKFELD_FLAECHENDECKENDES_FEUER_STOP: - gef_wirkfeld_flaechendeckendes_feuer_stop_meldung_rt wirkfeld_flaechendeckendes_feuer_stop_meldung; - - case GEF_WIRKFELD_FLAECHENDECKENDES_FEUER_FORTSETZEN: - gef_wirkfeld_flaechendeckendes_feuer_fortsetzen_meldung_rt wirkfeld_flaechendeckendes_feuer_fortsetzen_meldung; - - case GEF_WIRKFELD_MINENSPERRE: - gef_wirkfeld_minensperre_meldung_rt wirkfeld_minensperre_meldung; - - case GEF_WIRKFELD_STATUS_MINENSPERRE: - gef_wirkfeld_status_minensperre_meldung_rt wirkfeld_status_minensperre_meldung; - - case GEF_WIRKFELD_A_KAMPFMITTEL: - gef_wirkfeld_a_kampfmittel_meldung_rt wirkfeld_a_kampfmittel_meldung; - - case GEF_WIRKFELD_C_KAMPFSTOFF: - gef_wirkfeld_c_kampfstoff_meldung_rt wirkfeld_c_kampfstoff_meldung; - - case GEF_DEAKTIVIERUNG_WIRKFELD: - gef_deaktivierung_wirkfeld_meldung_rt deaktivierung_wirkfeld_meldung; - - case GEF_WIRKFELD_AENDERUNG_BEZEICHNER: - gef_wirkfeld_aenderung_bezeichner_meldung_rt wirkfeld_aenderung_bezeichner_meldung; - - case GEF_DEAKTIVIERUNG_EINZELMINE: - gef_deaktivierung_einzelmine_meldung_rt deaktivierung_einzelmine_meldung; - - case GEF_REAKTIVIERUNG_DUS_MINE: - gef_reaktivierung_dus_mine_meldung_rt reaktivierung_dus_mine_meldung; - - case GEF_DEFINITION_IED: - gef_definition_ied_rt definition_ied; - - case GEF_ZUSTAND_IED: - gef_zustand_ied_rt zustand_ied; - - case GEF_STATUS_EINZELMINENSIMULATOR: - gef_status_einzelminensimulator_rt status_einzelminensimulator_rt; - - case GEF_WIRKFELD_EINZELMINENSIMULATOR: - gef_wirkfeld_einzelminensimulator_rt wirkfeld_einzelminensimulator_rt; - - case GEF_TREFFER_AUSLOESUNG: - gef_treffer_ausloesung_meldung_rt treffer_ausloesung_meldung; - - case GEF_FUNKTIONSRAUM: - gef_funktionsraum_meldung_rt funktionsraum_meldung; - - case GEF_DEAKTIVIEREN_FUNKTIONSRAUM: - gef_deaktivieren_funktionsraum_meldung_rt deaktivieren_funktionsraum_meldung; - - case GEF_DATENVERKEHR_TDS_SRT: - gef_datenverkehr_tds_srt_meldung_rt datenverkehr_tds_srt_meldung; - - case GEF_DATENVERKEHR_TDS_DMF: - gef_datenverkehr_tds_dmf_meldung_rt datenverkehr_tds_dmf_meldung_meldung; - - case GEF_STEUERUNG_VERKEHRSAUFKOMMEN: - gef_steuerung_verkehrsaufkommen_meldung_rt steuerung_verkehrsaufkommen_meldung; - - case GEF_NACHFORDERUNG_BROADCAST_TELEGRAMME: - gef_nachforderung_broadcast_telegramme_meldung_rt nachforderung_broadcast_telegramme_meldung; - - case GEF_NOP: - gef_nop_meldung_rt nop_meldung; - - case GEF_SPRACHAUSWAHL: - gef_sprachauswahl_meldung_rt sprachauswahl_meldung; - - case GEF_ALLGEMEINE_NACHRICHT: - gef_allgemeine_nachricht_meldung_rt allgemeine_nachricht_meldung; - -/* case GEF_ECHO_ON_OFF: - case GEF_ESW_MELDUNG: - case GEF_GEFECHTSFELDTELEGRAMM: */ - - case GEF_WF_SAMMELDEAKTIVIERUNG: - gef_wf_sammeldeaktivierung_meldung_rt wf_sammeldeaktivierung_meldung; - - case GEF_WF_SAMMELDEAKTIVIERUNG_DUS_MINEN: - gef_wf_sammeldeaktivierung_dus_minen_meldung_rt wf_sammeldeaktivierung_dus_minen_meldung; - - case GEF_WF_SAMMELDEAKTIVIERUNG_FUNKTIONSRAUM: - gef_wf_sammeldeaktivierung_funktionsraum_meldung_rt wf_sammeldeaktivierung_funktionsraum_meldung; - - case GEF_DATENVERKEHR_TDS_GEOP: - gef_datenverkehr_tds_geop_meldung_rt datenverkehr_tds_geop_meldung; - - case GEF_DATENVERKEHR_TDS_TGTS: - gef_datenverkehr_tds_tgts_meldung_rt datenverkehr_tds_tgts_meldung; - - case GEF_KONFIGURATION_IPS: - gef_konfiguration_ips_meldung_rt konfiguration_ips_meldung; - - case GEF_KONFIGURATION_ZEG: - gef_konfiguration_zeg_meldung_rt konfiguration_zeg_meldung; - - case GEF_AUSLOESUNG_DUS_TREFFER: - gef_ausloesung_dus_treffer_rt gef_ausloesung_dus_treffer; - - case GEF_ANFORDERUNG_SW_VERSION: - gef_anforderung_sw_version_rt anforderung_sw_version; - case GEF_SW_VERSIONSMELDUNG: - gef_automatic_conversion_rt manipulations_meldung; - - case GEF_TREFFER_EREIGNIS_SEKUNDAERWIRKUNG: - gef_treffer_ereignis_sekundaerwirkung_rt treffer_ereignis_sekundaerwirkung; - - case GEF_NOTRUF: - gef_notruf_rt notruf; - - default: - void; -}; - -/* -struct dafu_tele { - u_long telegramm_zaehler; - unsigned short telegramm_prioritaet; - gef_tg_nd_ daten; -}; -*/ diff --git a/qt6-after/qt6-migrated-legatus/include/AlarmManagement/svcalmcommon_export.h b/qt6-after/qt6-migrated-legatus/include/AlarmManagement/svcalmcommon_export.h deleted file mode 100644 index 2a6e18f8e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/AlarmManagement/svcalmcommon_export.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SVCALMCOMMON_EXPORT_H -#define SVCALMCOMMON_EXPORT_H - -// Stub export macro for AlarmManagement -#define SVCALMCOMMON_EXPORT -#define SVCALMCOMMON_NO_EXPORT - -#endif // SVCALMCOMMON_EXPORT_H \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/AreaEffectSimulation/aes_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/AreaEffectSimulation/aes_enums.hpp.stub deleted file mode 100644 index 2f85ab8f6..000000000 --- a/qt6-after/qt6-migrated-legatus/include/AreaEffectSimulation/aes_enums.hpp.stub +++ /dev/null @@ -1,28 +0,0 @@ -// Stub file for aes_enums.hpp - used when BUILD_RTI=OFF -#ifndef AES_ENUMS_HPP -#define AES_ENUMS_HPP - -// Minimal stub - actual enums generated by rtiddsgen when BUILD_RTI=ON - -namespace AreaEffectSimulation { - -// Stub enum definitions for compilation when BUILD_RTI=OFF -enum class SymbolAppearance { - Solid = 0, - Dashed = 1, - Dotted = 2 -}; - -enum class SymbolVisibility { - Visible = 0, - Hidden = 1 -}; - -struct UnitSymbolPosition { - double x = 0.0; - double y = 0.0; -}; - -} // namespace AreaEffectSimulation - -#endif // AES_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/AssetManagement/asm_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/AssetManagement/asm_enums.hpp.stub deleted file mode 100644 index a5b1343e5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/AssetManagement/asm_enums.hpp.stub +++ /dev/null @@ -1,28 +0,0 @@ -// Stub file for asm_enums.hpp - used when BUILD_RTI=OFF -#ifndef ASM_ENUMS_HPP -#define ASM_ENUMS_HPP - -#include - -namespace AssetManagement { - -enum class SymbolAppearance : std::int32_t { - Solid = 0, - Dashed = 1, - Dotted = 2 -}; - -enum class SymbolVisibility : std::int32_t { - Visible = 0, - Hidden = 1 -}; - -struct UnitSymbolPosition { - double x = 0.0; - double y = 0.0; - double z = 0.0; -}; - -} // namespace AssetManagement - -#endif // ASM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/AudioVideoManagement/avm_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/AudioVideoManagement/avm_enums.hpp.stub deleted file mode 100644 index af2e85150..000000000 --- a/qt6-after/qt6-migrated-legatus/include/AudioVideoManagement/avm_enums.hpp.stub +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @file avm_enums.hpp - * @brief Stub file for AudioVideoManagement enums (BUILD_RTI=OFF) - * - * This file provides stub definitions when RTI DDS code generation is disabled. - * Replace with generated file when BUILD_RTI=ON. - */ - -#ifndef AVM_ENUMS_HPP -#define AVM_ENUMS_HPP - -namespace AudioVideoManagement -{ - -// Stub enum definitions for compilation without RTI DDS -enum class StreamType -{ - UNKNOWN = 0, - AUDIO = 1, - VIDEO = 2, - AUDIO_VIDEO = 3 -}; - -enum class ConnectionState -{ - DISCONNECTED = 0, - CONNECTING = 1, - CONNECTED = 2, - ERROR = 3 -}; - -} // namespace AudioVideoManagement - -#endif // AVM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/Core/core_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/Core/core_enums.hpp.stub deleted file mode 100644 index 1c91d34cb..000000000 --- a/qt6-after/qt6-migrated-legatus/include/Core/core_enums.hpp.stub +++ /dev/null @@ -1,24 +0,0 @@ -// Stub file for core_enums.hpp - used when BUILD_RTI=OFF -#ifndef CORE_ENUMS_HPP -#define CORE_ENUMS_HPP - -#include - -namespace Core { - -enum class LogLevel : std::int32_t { - Debug = 0, - Info = 1, - Warning = 2, - Error = 3 -}; - -enum class ComponentState : std::int32_t { - Stopped = 0, - Running = 1, - Paused = 2 -}; - -} // namespace Core - -#endif // CORE_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ExerciseEventManagement/eem_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/ExerciseEventManagement/eem_enums.hpp.stub deleted file mode 100644 index cf4aa177f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ExerciseEventManagement/eem_enums.hpp.stub +++ /dev/null @@ -1,24 +0,0 @@ -// Stub file for eem_enums.hpp - used when BUILD_RTI=OFF -#ifndef EEM_ENUMS_HPP -#define EEM_ENUMS_HPP - -#include - -namespace ExerciseEventManagement { - -enum class EventState : std::int32_t { - Pending = 0, - Active = 1, - Completed = 2, - Cancelled = 3 -}; - -enum class EventPriority : std::int32_t { - Low = 0, - Medium = 1, - High = 2 -}; - -} // namespace ExerciseEventManagement - -#endif // EEM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_data_plugin_interface.h b/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_data_plugin_interface.h deleted file mode 100644 index 791898f71..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_data_plugin_interface.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @RDE_HEADER@ - * HMI Plugin for Exercisemanagemt (Interface for access from other Plugins) - */ - -#pragma once - -#include -#include -#include -#include - -namespace ExerciseManagement -{ -/** - * @brief The DataInterface class provides the Topics Clients only for the GUI Plugins - */ -class DataInterface : public DataPluginBase::Interface -{ -public: - using DataPluginBase::Interface::Interface; - - virtual std::shared_ptr getDtc() = 0; - virtual std::shared_ptr getFtc() = 0; -}; - -} // namespace ExerciseManagement \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_enums.hpp.stub deleted file mode 100644 index 934fd1da0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_enums.hpp.stub +++ /dev/null @@ -1,34 +0,0 @@ -// Stub file for exm_enums.hpp - used when BUILD_RTI=OFF -#ifndef EXM_ENUMS_HPP -#define EXM_ENUMS_HPP - -#include - -namespace ExerciseManagement { - -enum class ExerciseState : std::int32_t { - Planned = 0, - Running = 1, - Paused = 2, - Finished = 3 -}; - -enum class ExerciseType : std::int32_t { - Training = 0, - Operational = 1, - Test = 2 -}; - -enum class SymbolAppearance : std::int32_t { - Solid = 0, - Outline = 1 -}; - -enum class SymbolVisibility : std::int32_t { - Visible = 0, - Hidden = 1 -}; - -} // namespace ExerciseManagement - -#endif // EXM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_exercise.h b/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_exercise.h deleted file mode 100644 index 87a3e5538..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exm_exercise.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert -// Für die Migration erstellen wir minimale Typ-Definitionen - -#include -#include -#include "exmcommon_export.h" -#include "exm_enums.hpp" - -namespace ExerciseManagement -{ - -// STUB: Exercise - wird durch echten DDS-Typ ersetzt -struct EXMCOMMON_EXPORT Exercise -{ - int id = 0; - QString m_name; - int phase = 0; // Exercise phase ID - SymbolAppearance symbolAppearance = SymbolAppearance::Solid; - SymbolVisibility symbolVisibility = SymbolVisibility::Visible; - - [[nodiscard]] std::string name() const { return m_name.toStdString(); } - // Weitere Felder werden bei Bedarf ergänzt -}; - -// Stream operator for logging -inline std::ostream& operator<<(std::ostream& os, const Exercise& ex) { - os << "Exercise(id=" << ex.id << ", name=" << ex.m_name.toStdString() << ")"; - return os; -} - -} // namespace ExerciseManagement \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exmcommon_export.h b/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exmcommon_export.h deleted file mode 100644 index 84ddeead4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ExerciseManagement/exmcommon_export.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -// Export-Macro für ExerciseManagement Module -// STUB: Wird normalerweise von CMake generiert - -#ifdef EXMCOMMON_LIBRARY - #define EXMCOMMON_EXPORT Q_DECL_EXPORT -#else - #define EXMCOMMON_EXPORT Q_DECL_IMPORT -#endif \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft.h b/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft.h deleted file mode 100644 index 0990f2616..000000000 --- a/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert -// Für die Migration erstellen wir minimale Typ-Definitionen - -#include -#include -#include "gna_export.h" - -namespace GuezNasat -{ - -// STUB: NasatAircraft - wird durch echten DDS-Typ ersetzt -struct NasatAircraft -{ - int idValue = 0; - QString nameValue; - int exerciseIdValue = 0; - int nasatIdValue = 0; - bool simulationActiveValue = false; - - // Getter-Methoden für Kompatibilität - int id() const { return idValue; } - QString name() const { return nameValue; } - int exerciseId() const { return exerciseIdValue; } - int nasatId() const { return nasatIdValue; } - bool simulationActive() const { return simulationActiveValue; } - - // Stream operator für Logger - friend std::ostream& operator<<(std::ostream& os, const NasatAircraft& aircraft); -}; - -// STUB: NasatAircraftParticipant - wird durch echten DDS-Typ ersetzt -struct NasatAircraftParticipant -{ - int idValue = 0; - int nasatAircraftIdValue = 0; - int exerciseIdValue = 0; - int participantIdValue = 0; - - // Getter-Methoden für Kompatibilität - int id() const { return idValue; } - int nasatAircraftId() const { return nasatAircraftIdValue; } - int exerciseId() const { return exerciseIdValue; } - int participantId() const { return participantIdValue; } - - // Stream operator für Logger - friend std::ostream& operator<<(std::ostream& os, const NasatAircraftParticipant& participant); -}; - -} // namespace GuezNasat - -// Stream-Operator Implementierung -namespace GuezNasat -{ -inline std::ostream& operator<<(std::ostream& os, const NasatAircraft& aircraft) -{ - os << "NasatAircraft{id=" << aircraft.id() << ", name=" << aircraft.name().toStdString() - << ", exerciseId=" << aircraft.exerciseId() << ", nasatId=" << aircraft.nasatId() - << ", simulationActive=" << aircraft.simulationActive() << "}"; - return os; -} - -inline std::ostream& operator<<(std::ostream& os, const NasatAircraftParticipant& participant) -{ - os << "NasatAircraftParticipant{id=" << participant.id() - << ", nasatAircraftId=" << participant.nasatAircraftId() - << ", exerciseId=" << participant.exerciseId() - << ", participantId=" << participant.participantId() << "}"; - return os; -} -} // namespace GuezNasat \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft_participant.h b/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft_participant.h deleted file mode 100644 index 26c754ea3..000000000 --- a/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_nasat_aircraft_participant.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -// STUB-HEADER: Diese Datei wird normalerweise von DDS generiert - -// NasatAircraftParticipant ist bereits in gna_nasat_aircraft.h definiert -#include "gna_nasat_aircraft.h" \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_translation.h b/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_translation.h deleted file mode 100644 index 338e78557..000000000 --- a/qt6-after/qt6-migrated-legatus/include/GuezNasat/gna_translation.h +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @RDE_HEADER@ - * Translation helper for GuezNasat module - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#pragma once - -// filename: gna_translation.h - -#include -#include -#include "svcgnacommon_export.h" - -namespace GuezNasat -{ -/** - * @brief Translation helper function - * - * Wrapper for QObject::tr() to enable translation in non-QObject classes - */ -GNA_COMMON_EXPORT inline QString tr(const char* sourceText, const char* comment = nullptr) -{ - return QObject::tr(sourceText, comment); -} - -} // namespace GuezNasat \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/GuezNasat/svcgnacommon_export.h b/qt6-after/qt6-migrated-legatus/include/GuezNasat/svcgnacommon_export.h deleted file mode 100644 index 65f1be314..000000000 --- a/qt6-after/qt6-migrated-legatus/include/GuezNasat/svcgnacommon_export.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SVCGNACOMMON_EXPORT_H -#define SVCGNACOMMON_EXPORT_H - -// Stub export macro for BUILD_RTI=OFF -#define SVCGNACOMMON_EXPORT - -#endif // SVCGNACOMMON_EXPORT_H \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_enums.hpp.stub deleted file mode 100644 index d020415c4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_enums.hpp.stub +++ /dev/null @@ -1,69 +0,0 @@ -// Stub file for ism_enums.hpp - used when BUILD_RTI=OFF -#ifndef ISM_ENUMS_HPP -#define ISM_ENUMS_HPP - -#include - -namespace InfrastructureManagement { - -enum class InfrastructureState : std::int32_t { - Online = 0, - Offline = 1, - Maintenance = 2 -}; - -enum class ConnectionType : std::int32_t { - Wired = 0, - Wireless = 1, - Satellite = 2 -}; - -// DDS-style enum wrapper -struct MountingPointType_def { - enum type : std::int32_t { - Undefined = 0, - Rack = 1, - Shelf = 2, - Slot = 3, - Module = 4, - Port = 5, - Cable = 6, - Connector = 7 - }; -}; - -struct MountingPointState_def { - enum type : std::int32_t { - Undefined = 0, - Planned = 1, - Installed = 2, - InService = 3, - OutOfService = 4, - Defect = 5 - }; -}; - -// Also provide enum class for direct usage -enum class MountingPointType : std::int32_t { - Undefined = 0, - Rack = 1, - Shelf = 2, - Slot = 3, - Module = 4, - Port = 5, - Cable = 6, - Connector = 7 -}; - -enum class MountingPointState : std::int32_t { - Undefined = 0, - Planned = 1, - Installed = 2, - InService = 3, - OutOfService = 4, - Defect = 5 -}; - -} // namespace InfrastructureManagement - -#endif // ISM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_mounting_point.h b/qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_mounting_point.h deleted file mode 100755 index 88aa46b44..000000000 --- a/qt6-after/qt6-migrated-legatus/include/InfrastructureManagement/ism_mounting_point.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * @RDE_HEADER@ - * The MountingPoint class wraps all information from InfrastructureManagement which defines a mounting point - * $Id$ - * $HeadURL$ - * $Author$ - * Created by Hannes Baeuerle, SLSE, 2017-01-16 - */ - -#pragma once - -#include "ismshared_export.h" -#include "ism.hpp" -#include - - -namespace dds -{ -namespace core -{ -static inline uint qHash(const InfrastructureManagement::MountingPointType &mpt) -{ - return ::qHash(static_cast(mpt)); -} -} // namespace core -} // namespace dds - -namespace InfrastructureManagement -{ - -class ISMSHARED_EXPORT MountingPoint -{ -public: - explicit MountingPoint(); - explicit MountingPoint(const StructureElement &data, int floorId); - static void init(); - - const StructureElement &data() const { return m_data; } - void updateData(const StructureElement &data, int floorId) { m_data = data; m_floor = floorId; } - int32_t id() const { return m_data.id; } - int32_t associatedAssetId() const { return m_associatedAssetId; } - bool hasAssociatedAsset() const { return m_associatedAssetId > 0; } - bool hasAssociatedAssetDefect() const { return m_hasAssociatedAssetDefect; } - - /*! \name aimState depends on the (loaded) plan/schedule!!! */ - //@{ - - //! \brief aimState of currently loaded schedule!!! - //! \return aimState - MountingPointState aimState() const { return m_aimState; } - void setAimState(const MountingPointState &mps) { m_aimState = mps;} - - //@} - - bool isValid() const { return m_isValid; } - Core::GeoPosition geoPosition() const { return m_data.geoPosition; } - Core::RelativePosition relPosition() const { return m_data.relPosition; } - MountingPointType type() const { return m_data.mountingPointTypeId; } - int32_t buildingId() const { return m_data.mainStructureElementId; } - QString name() const; - QString fileName() const; - QByteArray properties() const { return m_data.properties.c_str(); } - - QImage toImage(int32_t edgeLength = 100) const; - bool writeFile(int32_t edgeLength = 25) const; - int floor() const { return m_floor; } - void setFloor(int floor) { m_floor = floor; } - - void setAssociatedAssetId(int32_t id); - void setHasAssociatedAssetDefect(bool hasAssociatedAssetDefect); - MountingPointState getNextMountingPointState(const MountingPointState currState); - -private: // methods - -private: // attributes - StructureElement m_data; - int32_t m_associatedAssetId; - MountingPointState m_aimState; - bool m_hasAssociatedAssetDefect; - bool m_isValid; - int m_floor; - -public: - - enum class MpColor - { - GRAY, - BLUE, - RED, - GREEN, - ORANGE - }; - static QString mpColorToString(MpColor mpColor); - static QString mpColorToPostfix(MpColor mpColor); - - struct NameImagePair - { - NameImagePair(const QString &name = QString(), - const QImage &img = QImage()) - : m_name(name), m_img(img) - {} - QString m_name; // like announcement_BLUE - QImage m_img; - }; - struct MpNameImageData - { - NameImagePair nipGray; - NameImagePair nipBlue; - NameImagePair nipRed; - NameImagePair nipGreen; - NameImagePair nipOrange; - }; - - // - // Some methods regarding ImageTable: - // - static QMap &getImageTable(); // contains images in good quality (100*100px) - - static bool getImageAttributePlanActivity(const MountingPoint& mp, - QImage &imgOut, QString &attribNameOut); - static bool getImageAttributePlanDefinition(const MountingPoint& mp, - QImage &imgOut, QString &attribNameOut); - - static bool getImageAttribute(const MountingPoint& mp, MpColor mpColor, - QImage &img, QString &attribName); - -private: - static QMap &getImageTableInternal(); - static void insertHelper(MountingPointType::type type, - const QString &name, - const QString &colorCodeGray, - const QString &colorCodeGreen, - const QString &colorCodeRed, - const QString &colorCodeOrange, - const QString &defName = QString()); - - static QImage getImage(const MountingPoint &mp); - - static const MpNameImageData *getNameImageData(const MountingPoint&mp); - static const NameImagePair *getNameImagePair(const MountingPoint&mp); - - -}; // class MountingPoint - -} // namespace InfrastructureManagement diff --git a/qt6-after/qt6-migrated-legatus/include/Lts/Common/ProjectConfig/project_defines.h b/qt6-after/qt6-migrated-legatus/include/Lts/Common/ProjectConfig/project_defines.h deleted file mode 100755 index ecffa86ea..000000000 --- a/qt6-after/qt6-migrated-legatus/include/Lts/Common/ProjectConfig/project_defines.h +++ /dev/null @@ -1,78 +0,0 @@ - - - -#ifndef LTS_COMMON_PROJECTCONFIG_PROJECT_DEFINES_H -#define LTS_COMMON_PROJECTCONFIG_PROJECT_DEFINES_H - -#pragma once - -#include -#include - -namespace IDL -{ -enum class PartitionType -{ - Any, - Global, - Exercise, - AllExercises, - Replay, -}; - -inline std::string toStdString(PartitionType pt) -{ - switch (pt) - { - case PartitionType::Any: - return "Any"; - case PartitionType::Global: - return "Global"; - case PartitionType::Exercise: - return "Exercise"; - case PartitionType::AllExercises: - return "AllExercises"; - case PartitionType::Replay: - return "Replay"; - } - return std::string("invalid:") + std::to_string(static_cast(pt)); -} - -inline std::ostream& operator <<(std::ostream &o, PartitionType pt) -{ - - switch (pt) - { - case PartitionType::Any: - case PartitionType::Global: - case PartitionType::Exercise: - case PartitionType::AllExercises: - case PartitionType::Replay: - return o << std::string("PartitionType::") + toStdString(pt); - default: - return o << std::to_string(static_cast(pt)); - } -} - - - -inline std::string exercisePartition(int exerciseId) -{ - if (exerciseId < 0) - return { "ex_*" }; - return std::string("ex_") + std::to_string(exerciseId); -} - - - -inline std::string replayPartition(int partitionId) -{ - if (partitionId < 0) - return { "srp_*" }; - return std::string("srp_") + std::to_string(partitionId); -} - -} // namespace IDL - -#endif // LTS_COMMON_PROJECTCONFIG_PROJECT_DEFINES_H - diff --git a/qt6-after/qt6-migrated-legatus/include/LtsProjectionWorkstation/ltsprojectionworkstation_export.h b/qt6-after/qt6-migrated-legatus/include/LtsProjectionWorkstation/ltsprojectionworkstation_export.h deleted file mode 100644 index 38d1a7e9b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/LtsProjectionWorkstation/ltsprojectionworkstation_export.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -// Stub export header for LtsProjectionWorkstation -// (the real header is generated by CMake via GENERATE_EXPORT_HEADER when the -// library is built; this stub covers non-RTI builds and is found first on the -// -I line because the source include/ dir precedes the build tree) - -#ifndef LTSPROJECTIONWORKSTATION_EXPORT_H -#define LTSPROJECTIONWORKSTATION_EXPORT_H - -// Must expand to a default-visibility attribute, NOT to empty: the build sets -// CMAKE_CXX_VISIBILITY_PRESET=hidden, and this stub is found before the -// CMake-generated header (the source include/ dir precedes the build tree on -// the -I line). With an empty macro the LtsProjectionWorkstation class symbols -// would be hidden and consumers (e.g. OperatorApplication) fail to link -// libLtsProjectionWorkstation.so. -// If the library is not built, the attribute is harmless: it only changes -// visibility, not symbol resolution. -#if defined(_MSC_VER) -# define LTSPROJECTIONWORKSTATION_EXPORT __declspec(dllexport) -#else -# define LTSPROJECTIONWORKSTATION_EXPORT __attribute__((visibility("default"))) -#endif -#define LTSPROJECTIONWORKSTATION_NO_EXPORT - -#endif // LTSPROJECTIONWORKSTATION_EXPORT_H \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/LtsScriptTimeline/ltsscripttimeline_export.h b/qt6-after/qt6-migrated-legatus/include/LtsScriptTimeline/ltsscripttimeline_export.h deleted file mode 100644 index 82e45e9cc..000000000 --- a/qt6-after/qt6-migrated-legatus/include/LtsScriptTimeline/ltsscripttimeline_export.h +++ /dev/null @@ -1,12 +0,0 @@ -// STUB HEADER - Generated during Qt6 migration -// This file compensates for missing ltsscripttimeline_export.h when LtsScriptTimeline is not built -// Original would be generated by CMake GENERATE_EXPORT_HEADER for LtsScriptTimeline library - -#ifndef LTSSCRIPTTIMELINE_EXPORT_H -#define LTSSCRIPTTIMELINE_EXPORT_H - -// Stub export macros for BUILD_RTI=OFF or when LtsScriptTimeline is not built -#define LTSSCRIPTTIMELINE_EXPORT -#define LTSSCRIPTTIMELINE_NO_EXPORT - -#endif // LTSSCRIPTTIMELINE_EXPORT_H \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/LtsSession/ltssession_export.h b/qt6-after/qt6-migrated-legatus/include/LtsSession/ltssession_export.h deleted file mode 100644 index 46e11c1dd..000000000 --- a/qt6-after/qt6-migrated-legatus/include/LtsSession/ltssession_export.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef LTSSESSION_EXPORT_H -#define LTSSESSION_EXPORT_H - -// Stub export header for LtsSession when built without RTI -// This file is generated by CMake when building with RTI -// For non-RTI builds, we provide this stub - -// Must expand to a default-visibility attribute, NOT to empty: the build sets -// CMAKE_CXX_VISIBILITY_PRESET=hidden, and this stub is found before the -// CMake-generated header (the source include/ dir precedes the build tree on -// the -I line). With an empty macro the LtsSession class symbols would be -// hidden and consumers (e.g. LtsFileDialog) fail to link libLtsSession.so. -// If the library is not built, the attribute is harmless: it only changes -// visibility, not symbol resolution. -#if defined(_MSC_VER) -# define LTSSESSION_EXPORT __declspec(dllexport) -#else -# define LTSSESSION_EXPORT __attribute__((visibility("default"))) -#endif -#define LTSSESSION_NO_EXPORT - -#endif // LTSSESSION_EXPORT_H \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/LtsSession/ltssessiondata_export.h b/qt6-after/qt6-migrated-legatus/include/LtsSession/ltssessiondata_export.h deleted file mode 100644 index 6bc3a6bf0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/LtsSession/ltssessiondata_export.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Export definitions for LtsSessionData - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include - -#ifndef LTSSESSIONDATA_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define LTSSESSIONDATA_EXPORT -# else -# if defined(MAKE_LTSESSIONDATA_LIB) -# define LTSSESSIONDATA_EXPORT Q_DECL_EXPORT -# else -# define LTSSESSIONDATA_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrk_marker.h b/qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrk_marker.h deleted file mode 100644 index dc718028c..000000000 --- a/qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrk_marker.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert -// Für die Migration erstellen wir minimale Typ-Definitionen - -#include -#include -#include "mrkcommon_export.h" - -namespace MarkerManagement -{ - -// STUB: MarkerType enum -enum class MarkerType : int { Unknown = 0, Situation = 1, Audio = 2, Video = 3 }; - -// STUB: MarkerDescription - wird durch echten DDS-Typ ersetzt (muss VOR Marker deklariert werden) -struct MRKCOMMON_EXPORT MarkerDescription -{ - int id = 0; - QString name; - MarkerType markerType() const { return MarkerType::Unknown; } - void setMarkerType(MarkerType type) { Q_UNUSED(type); } - std::string content() const { return ""; } - // Weitere Felder werden bei Bedarf ergänzt -}; - -// STUB: Marker - wird durch echten DDS-Typ ersetzt -struct MRKCOMMON_EXPORT Marker -{ - int id = 0; - QString name; - int exerciseId = 0; - qint64 timeStamp() const { return 0; } - qint64 timeStampOffset() const { return 0; } - int operatorId() const { return 0; } - int fileContentId() const { return 0; } - std::string note() const { return ""; } - std::vector descriptions() const { return {}; } - // Weitere Felder werden bei Bedarf ergänzt -}; - -// STUB: toString Funktion für MarkerType -inline QString toString(MarkerType type) -{ - switch (type) - { - case MarkerType::Unknown: return QStringLiteral("Unknown"); - case MarkerType::Situation: return QStringLiteral("Situation"); - case MarkerType::Audio: return QStringLiteral("Audio"); - case MarkerType::Video: return QStringLiteral("Video"); - default: return QStringLiteral("Unknown"); - } -} - -} // namespace MarkerManagement \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrkcommon_export.h b/qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrkcommon_export.h deleted file mode 100644 index 407b64324..000000000 --- a/qt6-after/qt6-migrated-legatus/include/MarkerManagement/mrkcommon_export.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -// STUB-HEADER: Export-Macro für MarkerManagement -// Wird normalerweise von CMake generiert - -#ifdef _WIN32 - #ifdef MRKCOMMON_EXPORTS - #define MRKCOMMON_EXPORT __declspec(dllexport) - #else - #define MRKCOMMON_EXPORT __declspec(dllimport) - #endif -#else - #define MRKCOMMON_EXPORT __attribute__((visibility("default"))) -#endif \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/NotificationManagement/nom_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/NotificationManagement/nom_enums.hpp.stub deleted file mode 100644 index 18885e7ac..000000000 --- a/qt6-after/qt6-migrated-legatus/include/NotificationManagement/nom_enums.hpp.stub +++ /dev/null @@ -1,25 +0,0 @@ -// Stub file for nom_enums.hpp - used when BUILD_RTI=OFF -#ifndef NOM_ENUMS_HPP -#define NOM_ENUMS_HPP - -#include - -namespace NotificationManagement { - -enum class NotificationType : std::int32_t { - Info = 0, - Warning = 1, - Error = 2, - Critical = 3 -}; - -enum class NotificationPriority : std::int32_t { - Low = 0, - Normal = 1, - High = 2, - Urgent = 3 -}; - -} // namespace NotificationManagement - -#endif // NOM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_data_plugin_interface.h b/qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_data_plugin_interface.h deleted file mode 100644 index 9b8bf7a25..000000000 --- a/qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_data_plugin_interface.h +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @RDE_HEADER@ - * Data Plugin Interface for OperatorManagement (Interface for access from other Plugins) - */ - -#pragma once - -#include -#include -#include -#include - -namespace OperatorManagement -{ -class ForeignDataInterface; - -/** - * @brief The DataInterface class provides the Topics Clients only for the GUI Plugins - */ -class DataInterface : public DataPluginBase::Interface -{ -public: - using DataPluginBase::Interface::Interface; - - virtual std::shared_ptr getDtc() = 0; - virtual std::shared_ptr getFtc() = 0; - virtual std::shared_ptr getForeignDataInterface() = 0; -}; - -/** - * @brief The ForeignInterface class provides methods and signals for foreign plugins, that need - * access to the data of this DataPlugin - */ -class ForeignDataInterface -{ -public: - ForeignDataInterface() = default; - virtual ~ForeignDataInterface() = default; - - virtual void onSendKeepAlive() = 0; -}; - -} // namespace OperatorManagement \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_enums.hpp.stub deleted file mode 100644 index be184972a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/OperatorManagement/opm_enums.hpp.stub +++ /dev/null @@ -1,31 +0,0 @@ -// Stub file for opm_enums.hpp - used when BUILD_RTI=OFF -#ifndef OPM_ENUMS_HPP -#define OPM_ENUMS_HPP - -#include - -namespace OperatorManagement { - -enum class AccessControlLevel : std::int32_t { - None = 0, - ReadOnly = 1, - Operator = 2, - Supervisor = 3, - Administrator = 4 -}; - -enum class OperatorState : std::int32_t { - Offline = 0, - Online = 1, - Busy = 2, - Away = 3 -}; - -enum class GroupType : std::int32_t { - Standard = 0, - Special = 1 -}; - -} // namespace OperatorManagement - -#endif // OPM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppm_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppm_enums.hpp.stub deleted file mode 100644 index 5854c1700..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppm_enums.hpp.stub +++ /dev/null @@ -1,49 +0,0 @@ -// Stub file for ppm_enums.hpp - used when BUILD_RTI=OFF -#ifndef PPM_ENUMS_HPP -#define PPM_ENUMS_HPP - -#include -#include - -namespace ParticipantManagement { - -enum class ParticipantState : std::int32_t { - Active = 0, - Inactive = 1, - Suspended = 2 -}; - -enum class ParticipantRole : std::int32_t { - Observer = 0, - Player = 1, - Controller = 2, - Admin = 3 -}; - -enum class DataModification : std::int32_t { - eAdded = 0, - eModified = 1, - eRemoved = 2 -}; - -enum class TypeClass : std::int32_t { - eUninitialized = 0, - ePlatform = 1, - ePerson = 2, - eEvent = 3 -}; - -inline std::ostream& operator<<(std::ostream& os, TypeClass tc) { - switch (tc) { - case TypeClass::eUninitialized: os << "eUninitialized"; break; - case TypeClass::ePlatform: os << "ePlatform"; break; - case TypeClass::ePerson: os << "ePerson"; break; - case TypeClass::eEvent: os << "eEvent"; break; - default: os << "Unknown"; break; - } - return os; -} - -} // namespace ParticipantManagement - -#endif // PPM_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppmcommon_export.h b/qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppmcommon_export.h deleted file mode 100644 index 12a899dab..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ParticipantManagement/ppmcommon_export.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -// Export-Macro für ParticipantManagement Module -// STUB: Wird normalerweise von CMake generiert - -#ifdef PPMCOMMON_LIBRARY - #define PPMCOMMON_EXPORT Q_DECL_EXPORT -#else - #define PPMCOMMON_EXPORT Q_DECL_IMPORT -#endif \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ProjectDataManagement/project_data_management.hpp b/qt6-after/qt6-migrated-legatus/include/ProjectDataManagement/project_data_management.hpp deleted file mode 100644 index e1cfae2c1..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ProjectDataManagement/project_data_management.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -// STUB-Header: Diese Datei wird normalerweise von DDS/Codegenerator generiert -// Für die Migration erstellen wir minimale Typ-Definitionen - -#include "pdm_types.h" - -namespace ProjectDataManagement -{ - -// EventType wird bereits in pdm_types.h definiert - -// STUB: EventType_def - Platzhalter für DDS-generierten Typ -// Wird in AlarmManagement für Event-Typisierung verwendet -struct EventType_def -{ - int value{0}; - - EventType_def() = default; - explicit EventType_def(int v) : value(v) {} - explicit EventType_def(EventType t) : value(static_cast(t)) {} - - bool operator==(const EventType_def& other) const { return value == other.value; } - bool operator!=(const EventType_def& other) const { return value != other.value; } - bool operator<(const EventType_def& other) const { return value < other.value; } -}; - -// STUB: EventData - Basisstruktur für Event-Daten -struct EventData -{ - EventType_def eventType; - QString description; - qint64 timestamp{0}; -}; - -} // namespace ProjectDataManagement \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/ReportManagement/rep_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/ReportManagement/rep_enums.hpp.stub deleted file mode 100644 index a741cbd91..000000000 --- a/qt6-after/qt6-migrated-legatus/include/ReportManagement/rep_enums.hpp.stub +++ /dev/null @@ -1,24 +0,0 @@ -// Stub file for rep_enums.hpp - used when BUILD_RTI=OFF -#ifndef REP_ENUMS_HPP -#define REP_ENUMS_HPP - -#include - -namespace ReportManagement { - -enum class ReportType : std::int32_t { - Summary = 0, - Detailed = 1, - Statistical = 2 -}; - -enum class ReportFormat : std::int32_t { - PDF = 0, - HTML = 1, - XML = 2, - JSON = 3 -}; - -} // namespace ReportManagement - -#endif // REP_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/Services/PresentationManagement/svcprecommon_export.h b/qt6-after/qt6-migrated-legatus/include/Services/PresentationManagement/svcprecommon_export.h deleted file mode 100644 index fc0d8ff8f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/Services/PresentationManagement/svcprecommon_export.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Export definitions for svcPreCommon - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include - -#ifndef SVCCOMMON_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define SVCCOMMON_EXPORT -# else -# if defined(MAKE_SVCCOMMON_LIB) -# define SVCCOMMON_EXPORT Q_DECL_EXPORT -# else -# define SVCCOMMON_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/SituationReplay/srp_enums.hpp.stub b/qt6-after/qt6-migrated-legatus/include/SituationReplay/srp_enums.hpp.stub deleted file mode 100644 index cb174cfac..000000000 --- a/qt6-after/qt6-migrated-legatus/include/SituationReplay/srp_enums.hpp.stub +++ /dev/null @@ -1,25 +0,0 @@ -// Stub file for srp_enums.hpp - used when BUILD_RTI=OFF -#ifndef SRP_ENUMS_HPP -#define SRP_ENUMS_HPP - -#include - -namespace SituationReplay { - -enum class ReplayState : std::int32_t { - Stopped = 0, - Playing = 1, - Paused = 2, - Rewinding = 3 -}; - -enum class ReplaySpeed : std::int32_t { - QuarterSpeed = 0, - HalfSpeed = 1, - NormalSpeed = 2, - DoubleSpeed = 3 -}; - -} // namespace SituationReplay - -#endif // SRP_ENUMS_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/TopicEditorBase/topiceditorbase_export.h b/qt6-after/qt6-migrated-legatus/include/TopicEditorBase/topiceditorbase_export.h deleted file mode 100644 index 2addcea2e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/TopicEditorBase/topiceditorbase_export.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef TOPICEDITORBASE_EXPORT_H -#define TOPICEDITORBASE_EXPORT_H - -// Stub export header for TopicEditorBase when built without RTI -// This file is generated by CMake when building with RTI -// For non-RTI builds, we provide this stub - -#define TOPICEDITORBASE_EXPORT -#define TOPICEDITORBASE_NO_EXPORT - -#endif // TOPICEDITORBASE_EXPORT_H \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/Viewer/SituationMap/ElevationMap/elevation_map_manager.h b/qt6-after/qt6-migrated-legatus/include/Viewer/SituationMap/ElevationMap/elevation_map_manager.h deleted file mode 100644 index 152147df1..000000000 --- a/qt6-after/qt6-migrated-legatus/include/Viewer/SituationMap/ElevationMap/elevation_map_manager.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * STUB-Header für ElevationMapManager - Qt6 Migration - * Diese Datei ermöglicht das Kompilieren von LtsElevation ohne das vollständige ElevationMap-Modul - */ - -#pragma once - -#include -#include -#include -#include -#include - -// QPoint3D ist bereits in LtsUtilsCore/qpoint3d.h definiert -// #include "LtsUtils/qpoint3d.h" // Wird von lts_elevation_manager.h included - -namespace LtsUtils -{ -// Forward-Referenz, Definition erfolgt in qpoint3d.h -struct QPoint3D; -} // namespace LtsUtils - -using LOSVector = std::vector; - -namespace SituationMap -{ - -// The NGL build uses -fvisibility=hidden; LtsElevation links this class -// across the shared library boundary, so it needs default visibility. -class __attribute__((visibility("default"))) ElevationMapManager final : public QObject -{ - Q_OBJECT - -public: - ElevationMapManager(); - ElevationMapManager(const ElevationMapManager &) = delete; - ElevationMapManager &operator = (const ElevationMapManager &) = delete; - ~ElevationMapManager(); - - int init(const QStringList &filePaths_rough_to_fine); - void cleanupCurrentContent(); - - bool waitForInitialization(); - bool isValid() const; - - double elevation(double lon_rad, double lat_rad, bool *bIsCovered = nullptr) const; - double elevation(double lon_rad, double lat_rad, double defaultValue, bool *bIsCovered = nullptr) const; - - QRectF simpleUnitedExtent() const; - - bool contains(const QPointF &point) const; - - void LOSProfile(const QPointF &start, const QPointF &end, LOSVector &losProfile); - - enum class LineOfSight { LOS_UNDEFINED = 0, - LOS_ERROR, - LOS_VISIBLE, - LOS_INVISIBLE }; - - LineOfSight lineOfSightCalculation(const LOSVector &losProfile, - double centerHat, - double objHat) const; - - LineOfSight lineOfSightCalculation(const LtsUtils::QPoint3D &startPointGeo_absZ, - const LtsUtils::QPoint3D &endPointGeo_absZ); - - LineOfSight lineOfSightCalculation(const QPointF &startPointGeo, double startHat, - const QPointF &endPointGeo, double endHat); - -protected: - class Private; - Private *d; -}; // ElevationMapManager - -} // namespace SituationMap \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/abstractlocalizer.h b/qt6-after/qt6-migrated-legatus/include/grantlee/abstractlocalizer.h deleted file mode 100644 index 243a5ce7d..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/abstractlocalizer.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_ABSTRACTLOCALIZER_H -#define GRANTLEE_ABSTRACTLOCALIZER_H - -#include "grantlee_templates_export.h" - -#include -#include -#include - -class QDateTime; - -namespace Grantlee -{ - -/** - @brief Interface for implementing an internationalization system. - - This class defines an interface for accessing an internationalization, such as - QLocale/QTranslator or gettext/KLocale. - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT AbstractLocalizer -{ -public: - /** - Constructor - */ - AbstractLocalizer(); - - /** - Destructor - */ - virtual ~AbstractLocalizer(); - - /** - Processes the data in @p variant into a localized string. - - The base implementation can localize numbers, dates and times, and - strings. - */ - virtual QString localize(const QVariant &variant) const; - - /** - Returns the current locale as a string. - */ - virtual QString currentLocale() const = 0; - - /** - Makes this localizer use the locale specified by @p localeName for output. - */ - virtual void pushLocale(const QString &localeName) = 0; - - /** - Makes this localizer use the previous locale for output. - */ - virtual void popLocale() = 0; - - /** - Loads the @p catalog from @p path. - */ - virtual void loadCatalog(const QString &path, const QString &catalog) = 0; - - /** - Unloads the @p catalog - */ - virtual void unloadCatalog(const QString &catalog) = 0; - - /** - Localizes @p number - */ - virtual QString localizeNumber(int number) const = 0; - - /** - Localizes @p number - */ - virtual QString localizeNumber(qreal number) const = 0; - - /** - Localizes @p value as a monetary value in the currency specified by @p - currencyCode. - */ - virtual QString localizeMonetaryValue(qreal value, const QString ¤cyCode - = {}) const = 0; - - /** - Localizes @p date with the specified @p formatType - */ - virtual QString localizeDate(const QDate &date, - QLocale::FormatType formatType - = QLocale::ShortFormat) const = 0; - - /** - Localizes @p time with the specified @p formatType - */ - virtual QString localizeTime(const QTime &time, - QLocale::FormatType formatType - = QLocale::ShortFormat) const = 0; - - /** - Localizes @p dateTime with the specified @p formatType - */ - virtual QString localizeDateTime(const QDateTime &dateTime, - QLocale::FormatType formatType - = QLocale::ShortFormat) const = 0; - - /** - Localizes @p string with the specified @p arguments for substitution - */ - virtual QString localizeString(const QString &string, - const QVariantList &arguments = {}) const = 0; - - /** - Localizes @p string, disambiguated by @p context with the specified @p - arguments for substitution - */ - virtual QString - localizeContextString(const QString &string, const QString &context, - const QVariantList &arguments = {}) const = 0; - - /** - Localizes @p string or its @p pluralForm with the specified @p arguments - for substitution - */ - virtual QString - localizePluralString(const QString &string, const QString &pluralForm, - const QVariantList &arguments = {}) const = 0; - - /** - Localizes @p string or its @p pluralForm, disambiguated by @p context with - the specified @p arguments for substitution - */ - virtual QString - localizePluralContextString(const QString &string, const QString &pluralForm, - const QString &context, - const QVariantList &arguments = {}) const = 0; - -private: - Q_DISABLE_COPY(AbstractLocalizer) -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/abstractmarkupbuilder.h b/qt6-after/qt6-migrated-legatus/include/grantlee/abstractmarkupbuilder.h deleted file mode 100644 index c63168048..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/abstractmarkupbuilder.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2008,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_ABSTRACTMARKUPBUILDER_H -#define GRANTLEE_ABSTRACTMARKUPBUILDER_H - -#include "grantlee_textdocument_export.h" - -#include -#include - -class QBrush; - -namespace Grantlee -{ - -class AbstractMarkupBuilderPrivate; - -/// @headerfile abstractmarkupbuilder.h grantlee/abstractmarkupbuilder.h - -/** - @brief Interface for creating marked-up text output. - - The **%AbstractMarkupBuilder** is used by a MarkupDirector to create marked-up - output such as html or markdown. - - See PlainTextMarkupBuilder and TextHTMLBuilder for example implementations. - - This interface can be extended to handle custom format types in a - QTextDocument. @see @ref custom_qtextobject - - @author Stephen Kelly -*/ -class GRANTLEE_TEXTDOCUMENT_EXPORT AbstractMarkupBuilder -{ -public: - /** Destructor */ - virtual ~AbstractMarkupBuilder() {} - - /** Begin a bold element in the markup */ - virtual void beginStrong() = 0; - - /** Close the bold element in the markup */ - virtual void endStrong() = 0; - - /** Begin an emphasised element in the markup */ - virtual void beginEmph() = 0; - - /** Close the emphasised element in the markup */ - virtual void endEmph() = 0; - - /** Begin an underlined element in the markup */ - virtual void beginUnderline() = 0; - - /** Close the underlined element in the markup */ - virtual void endUnderline() = 0; - - /** Begin a struck out element in the markup */ - virtual void beginStrikeout() = 0; - - /** Close the struck out element in the markup */ - virtual void endStrikeout() = 0; - - /** - Begin a decorarated foreground element in the markup (A text color) - using @p brush - */ - virtual void beginForeground(const QBrush &brush) = 0; - - /** Close the decorarated foreground element in the markup */ - virtual void endForeground() = 0; - - /** - Begin a decorarated background element in the markup (A text background - color) using @p brush - */ - virtual void beginBackground(const QBrush &brush) = 0; - - /** Close the decorarated background element in the markup */ - virtual void endBackground() = 0; - - /** - Begin a url anchor element in the markup - @param href The href of the anchor. - @param name The name of the anchor. - */ - virtual void beginAnchor(const QString &href = {}, const QString &name = {}) - = 0; - - /** Close the anchor element */ - virtual void endAnchor() = 0; - - /** - Begin a new font familiy element in the markup - @param family The name of the font family to begin. - */ - virtual void beginFontFamily(const QString &family) = 0; - - /** End font family element */ - virtual void endFontFamily() = 0; - - /** - Begin a new font point size element in the markup - @param size The point size to begin. - */ - virtual void beginFontPointSize(int size) = 0; - - /** End font point size element */ - virtual void endFontPointSize() = 0; - - /** - Begin a new paragraph in the markup - @param a The alignment of the new paragraph. - @param top The top margin of the new paragraph. - @param bottom The bottom margin of the new paragraph. - @param left The left margin of the new paragraph. - @param right The right margin of the new paragraph. - */ - virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, - qreal bottom = 0.0, qreal left = 0.0, - qreal right = 0.0) - = 0; - - /** Close the paragraph in the markup. */ - virtual void endParagraph() = 0; - /** Add a newline to the markup. */ - virtual void addNewline() = 0; - - /** - Insert a horizontal rule into the markup. - @param width The width of the rule. Default is full width. - */ - virtual void insertHorizontalRule(int width = -1) = 0; - - /** - Insert a new image element into the markup. - @param url The url of the image - @param width The width of the image - @param height The height of the image. - */ - virtual void insertImage(const QString &url, qreal width, qreal height) = 0; - - /** - Begin a new list element in the markup. - A list element contains list items, and may contain other lists. - @param style The style of list to create. - */ - virtual void beginList(QTextListFormat::Style style) = 0; - - /** - Close the list. - */ - virtual void endList() = 0; - - /** Begin a new list item in the markup */ - virtual void beginListItem() = 0; - - /** End the list item */ - virtual void endListItem() = 0; - - /** Begin a superscript element */ - virtual void beginSuperscript() = 0; - - /** End superscript element */ - virtual void endSuperscript() = 0; - - /** Begin a subscript element */ - virtual void beginSubscript() = 0; - - /** End subscript element */ - virtual void endSubscript() = 0; - - /** - Begin a table element. - - @param cellpadding The padding attribute for the table. - @param cellspacing The spacing attribute for the table. - @param width The width of the table. May be either an integer, or a - percentage value. - */ - virtual void beginTable(qreal cellpadding, qreal cellspacing, - const QString &width) - = 0; - - /** - Begin a new table row - */ - virtual void beginTableRow() = 0; - - /** - Begin a new table header cell. - @param width The width of the cell. - @param colSpan The column span of the cell. - @param rowSpan The row span of the cell. - */ - virtual void beginTableHeaderCell(const QString &width, int colSpan, - int rowSpan) - = 0; - - /** - Begin a new table cell. - @param width The width of the cell. - @param colSpan The column span of the cell. - @param rowSpan The row span of the cell. - */ - virtual void beginTableCell(const QString &width, int colSpan, int rowSpan) - = 0; - - /** End a table element */ - virtual void endTable() = 0; - - /** End a table row */ - virtual void endTableRow() = 0; - - /** End a table header cell */ - virtual void endTableHeaderCell() = 0; - - /** End a table cell */ - virtual void endTableCell() = 0; - - /** - Begin a level @p level header - @param level An integer between 1 and 6 - */ - virtual void beginHeader(int level) = 0; - - /** - End a level @p level header - @param level An integer between 1 and 6 - */ - virtual void endHeader(int level) = 0; - - /** - Append the plain text @p text to the markup - - @param text The text to append. - */ - virtual void appendLiteralText(const QString &text) = 0; - - /** - Append the raw text @p text to the markup. @p text is added unescaped - */ - virtual void appendRawText(const QString &text) = 0; - - /** - Return the fully marked up result of the building process. - - This may contain metadata etc, such as a head element in html. - - @return The fully marked up text. - */ - virtual QString getResult() = 0; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/bbcodebuilder.h b/qt6-after/qt6-migrated-legatus/include/grantlee/bbcodebuilder.h deleted file mode 100644 index f8126a6b9..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/bbcodebuilder.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_BBCODEBUILDER_H -#define GRANTLEE_BBCODEBUILDER_H - -#include "abstractmarkupbuilder.h" - -namespace Grantlee -{ - -/** - @brief Builder to create BBCode from a QTextDocument -*/ -class BBCodeBuilder : public AbstractMarkupBuilder -{ -public: - /** - Creates a new BBCodeBuilder. - */ - BBCodeBuilder(); - - ~BBCodeBuilder() override; - - void beginStrong() override; - void endStrong() override; - void beginEmph() override; - void endEmph() override; - void beginUnderline() override; - void endUnderline() override; - void beginStrikeout() override; - void endStrikeout() override; - void beginForeground(const QBrush &brush) override; - void endForeground() override; - - // Background colour not supported by BBCode. - - void beginAnchor(const QString &href = {}, const QString &name = {}) override; - void endAnchor() override; - - // Font family not supported by BBCode. - - /** - Begin an element of font size @p size. Note that this size is in pixels, - and must be converted before it is suitable for use in BBCode. - @param size The size of font to begin. - */ - void beginFontPointSize(int size) override; - void endFontPointSize() override; - - void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, - qreal bottom = 0.0, qreal left = 0.0, - qreal right = 0.0) override; - - void endParagraph() override; - void addNewline() override; - - void insertImage(const QString &src, qreal width, qreal height) override; - - void beginList(QTextListFormat::Style type) override; - - void endList() override; - - void beginListItem() override; - - void beginSuperscript() override; - - void endSuperscript() override; - - void beginSubscript() override; - - void endSubscript() override; - - void beginTable(qreal, qreal, const QString &) override; - - void beginTableRow() override; - - void appendLiteralText(const QString &text) override; - - /** - Escapes @p text appropriately for BBCode. - */ - const QString escape(const QString &text) const; - - QString getResult() override; - -private: - QList m_currentListItemStyles; - - QString m_text; - - Qt::Alignment m_currentAlignment; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/cachingloaderdecorator.h b/qt6-after/qt6-migrated-legatus/include/grantlee/cachingloaderdecorator.h deleted file mode 100644 index 652b3d3dc..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/cachingloaderdecorator.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_CACHINGLOADERDECORATOR_H -#define GRANTLEE_CACHINGLOADERDECORATOR_H - -#include "templateloader.h" - -#include "grantlee_templates_export.h" - -namespace Grantlee -{ - -class CachingLoaderDecoratorPrivate; - -/// @headerfile cachingloaderdecorator.h grantlee/cachingloaderdecorator.h - -/** - @brief Implements a loader decorator which caches compiled Template objects. - - The **%CachingLoaderDecorator** can be used with any implementation of - Grantlee::AbstractTemplateLoader. - - @code - auto loader = QSharedPointer::create(); - loader->setTemplateDirs({"/path/one", "/path/two"}); - - auto cache = - QSharedPointer::create( loader ); - m_engine->addTemplateLoader( cache ); - @endcode - - The effect is that templates do not need to be loaded from the filesystem and - compiled into Template objects on each access, but may be returned from the - cache instead. - - This can be significant if loading Templates in a loop, or loading the same - Template very often in an application. - - @code -
    - {% for item in list %} -
  • {% include "itemtemplate.html" %}
  • - {% endfor %} -
- @endcode - - If the loading of Templates is a bottleneck in an application, it may make - sense to use the caching decorator. - - @author Stephen Kelly - */ -class GRANTLEE_TEMPLATES_EXPORT CachingLoaderDecorator - : public AbstractTemplateLoader -{ -public: - /** - Constructor - */ - CachingLoaderDecorator(QSharedPointer loader); - - /** - Destructor - */ - ~CachingLoaderDecorator() override; - - bool canLoadTemplate(const QString &name) const override; - - QPair getMediaUri(const QString &fileName) const override; - - Template loadByName(const QString &name, - const Grantlee::Engine *engine) const override; - - /** - Clears the Templates objects cached in the decorator. - */ - void clear(); - - /** - Returns the number of Template objects cached in the decorator. - */ - int size() const; - - /** - Returns whether the cache is empty. - */ - bool isEmpty() const; - -private: - Q_DECLARE_PRIVATE(CachingLoaderDecorator) - CachingLoaderDecoratorPrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/context.h b/qt6-after/qt6-migrated-legatus/include/grantlee/context.h deleted file mode 100644 index 34010ed21..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/context.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_CONTEXT_H -#define GRANTLEE_CONTEXT_H - -#include "abstractlocalizer.h" -#include "grantlee_templates_export.h" - -#include - -namespace Grantlee -{ - -class RenderContext; - -class ContextPrivate; - -/// @headerfile context.h grantlee/context.h - -/** - @brief The **%Context** class holds the context to render a Template with. - - For application developers, using the **%Context** class is a matter of - inserting keys and values as appropriate for rendering a Template using the - @ref insert method. - - @code - auto t = engine->newTemplate( - "Name is {% name %} and age is {% age %}.", "some_template" ); - - Context c1; - c1.insert( "name", "Tom" ); - c1.insert( "age", 34 ); - - Context c2; - c2.insert( "name", "Harry" ); - c2.insert( "age", 43 ); - - t->render(c1); // Returns "Name is Tom and age is 43." - t->render(c2); // Returns "Name is Harry and age is 34." - @endcode - - Note that one Template may be rendered multiple times with different contexts. - Note also that any QVariant may be inserted into a **%Context** object. Most - commonly, QObjects will be used here. - @see @ref custom_objects - - @section context_stack Context Stack. - - For template tag developers, some other **%Context** API is relevant. - - It is possible to @ref push and @ref pop layers of context while a template - is being rendered. This is useful if your template tag makes additional - variables temporarily available in a part of a template. %Template tags - should only modify layers of context that they @ref push themselves, and - should @ref pop any layers created before finishing its rendering step. - - See for example the @gr_tag{with} tag. In a template such as - - @code - Some content - {% with person.name|toUpper as lowerName %} - Name is {% lowerName %} - {% endwith %} - @endcode - - In this case, lowerName is available in the context only between the - @gr_tag{with} and @gr_tag{endwith} tags. The implementation of - the @gr_tag{with} tag render method is: - - @code - void WithNode::render( OutputStream *stream, Context *c ) const - { - c->push(); - // {% with m_filterExpression as m_name %} - c->insert( m_name, m_filterExpression.resolve( c ) ); - m_list.render( stream, c ); - c->pop(); // The section of context defining m_name is removed. - } - @endcode - - Note that a **%Context** may temporarily override a variable in a parent - context. This is why it is important to @ref push a new context when adding - items to context and @ref pop it when finished. - - @code - Some content - {% with "foo" as var %} - Var is {% var %} // Var is "foo" - {% with "bar" as var %} - Var is {% var %} // Var is "bar" - {% endwith %} - Var is {% var %} // Var is "foo" - {% endwith %} - @endcode - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT Context -{ -public: - /** - Creates an empty context - */ - Context(); - /** - Sets every key in the hash as a property name with the variant as the - value. - */ - explicit Context(const QVariantHash &hash); - - /** - Copy Constructor - */ - Context(const Context &other); - - /** - Assignmant operator - */ - Context &operator=(const Context &other); - -#ifndef Q_QDOC - /** - @internal - - Whether to automatically escape all context content. This is not usually - used directly. Use the @gr_tag{autoescape} tag instead. - */ - bool autoEscape() const; - - /** - @internal - - Sets whether to automatically escape all context content. This is not - usually used directly. Use the @gr_tag{autoescape} tag instead. - */ - void setAutoEscape(bool autoescape); -#endif - /** - Destructor - */ - ~Context(); - - /** - Returns the context object identified by the key @p str - */ - QVariant lookup(const QString &str) const; - - /** - Insert the context object @p object identified by @p name into - the **%Context**. - */ - void insert(const QString &name, QObject *object); - - /** - Insert the context object @p variant identified by @p name into - the **%Context**. - */ - void insert(const QString &name, const QVariant &variant); - - /** - Pushes a new context. - @see @ref context_stack - */ - void push(); - - /** - Pops the context. - @see @ref context_stack - */ - void pop(); - -#ifndef Q_QDOC - /** - @internal Returns the context hash at depth @p depth. - */ - QVariantHash stackHash(int depth) const; - - /** - @internal - Returns whether template being rendered is being mutated. - */ - bool isMutating() const; - - /** - @internal - Sets whether template being rendered is being mutated to @p mutating. - */ - void setMutating(bool mutating); - - /** - @internal - */ - void addExternalMedia(const QString &absolutePart, - const QString &relativePart); - - /** - @internal - */ - void clearExternalMedia(); -#endif - - /** - Sets the @p localizer to be used. - - The **%Context** takes ownerwhip of the localizer. - */ - void setLocalizer(QSharedPointer localizer); - - /** - Returns the localizer currently in use. - */ - QSharedPointer localizer() const; - - /** - Returns the external media encountered in the Template while rendering. - */ - QList> externalMedia() const; - - /** - The type of urls to external media that should be put in the template. - */ - enum UrlType { - AbsoluteUrls, ///< Absolute URLs should be put in the template. - RelativeUrls ///< Relative URLs should be put in the template. - }; - - /** - Sets the type of external media URL to be used in the template to @p type. - @see @ref media_finder_tag - */ - void setUrlType(UrlType type); - - /** - The type of URL used in the template. - */ - UrlType urlType() const; - - /** - Sets the relative path to external media to be used in templates to @p - relativePath - - @see @ref media_finder_tag - */ - void setRelativeMediaPath(const QString &relativePath); - - /** - The relative path to external media to be used in templates. - */ - QString relativeMediaPath() const; - - /** - Returns a modifiable RenderContext. This may be used to make - Template rendering threadsafe so that render state does not need to be - stored in the Node implementation itself. - */ - RenderContext *renderContext() const; - -private: - Q_DECLARE_PRIVATE(Context) - ContextPrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/engine.h b/qt6-after/qt6-migrated-legatus/include/grantlee/engine.h deleted file mode 100644 index c73a9048d..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/engine.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_ENGINE_H -#define GRANTLEE_ENGINE_H - -#include "template.h" -#include "templateloader.h" - -namespace Grantlee -{ -class TagLibraryInterface; - -class EnginePrivate; - -/// @headerfile engine.h grantlee/engine.h - -/** - @brief **%Grantlee::Engine** is the main entry point for creating %Grantlee - Templates. - - The **%Grantlee::Engine** is responsible for configuring and creating Template - objects. In typical use, one or more AbstractTemplateLoader objects will be - added to the Engine to load template objects, and plugin directories will be - set to enable finding template tags and filters. - - @code - auto engine = new Engine(); - - auto loader = QSharedPointer::create(); - loader->setTemplateDirs( {"/usr/share/myapp/templates"} ); - engine->addTemplateLoader( loader ); - - engine->addPluginPath( "/usr/lib/myapp" ); - - auto template1 = engine->newTemplate( "Template content", "template name" ); - - auto template2 = engine->loadByName( "templatefile.html" ); - @endcode - - Once it is configured, the **%Engine** can be used to create new templates by - name by loading the templates with the @ref loadByName method, or by defining - the content in the @ref newTemplate method. - - By default the builtin tags and filters distributed with %Grantlee are - available in all templates without using the @gr_tag{load} tag in the - template. These pre-loaded libraries may be configured if appropriate to the - application. For example, an application which defines its own tags and - filters may want them to be always available, or it may be desirable to - restrict the features available to template authors by removing built in - libraries. - - Different **%Engine** objects can be used to create templates with differing - configurations. - - @section smart_trim Insignificant whitespace - - The output of rendering a template depends on the content of the template. In - some cases when generating content in which whitespace is significant, this - can have undesired effects. For example, given a template to generate C++ code - like: - - @verbatim - class MyClass { - {# This loop creates the #} - {# methods in the class #} - {% for method in methods %} - {% if method.hasDox %} - {{ method.dox }} - {% endif %} - {{ method.signature }} - {% endfor %} - }; - @endverbatim - - The output would have a lot of whitespace which is not necessarily wanted. - - @code - class MyClass { - - - - - void foo() const; - - }; - @endcode - - It is possible to strip insignificant whitespace by enabling the smartTrim - feature with @ref setSmartTrimEnabled. When enabled the output will not - contain a newline for any line in the template which has only one token of - template syntax, such as a comment, tag or variable. - - @code - class MyClass { - - void foo() const; - }; - @endcode - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT Engine : public QObject -{ - Q_OBJECT -public: - /** - Constructor - */ - Engine(QObject *parent = {}); - - /** - Destructor. - */ - ~Engine() override; - - /** - Returns the TemplateLoaders currently configured on the **%Engine**. - */ - QList> templateLoaders(); - - /** - Adds @p loader to the TemplateLoaders currently configured on - the **%Engine**. - */ - void addTemplateLoader(QSharedPointer loader); - - /** - Sets the plugin dirs currently configured on the **%Engine** to @p dirs. - - @warning This overwrites the default paths. You normally want - @ref addPluginPath. - - @see @ref finding_plugins - */ - void setPluginPaths(const QStringList &dirs); - - /** - Prepend @p dir to the list of plugin dirs. - */ - void addPluginPath(const QString &dir); - - /** - Removes all instances of @p dir from the list of plugin dirs. - */ - void removePluginPath(const QString &dir); - - /** - Returns the currently configured plugin dirs - */ - QStringList pluginPaths() const; - - /** - Returns a URI for a media item with the name @p name. - - Typically this will be used for images. For example the media URI for the - image "header_logo.png" may be - "/home/user/common/header_logo.png" or - "/home/user/some_theme/header_logo.png" - depending on the @ref templateLoaders configured. - - This method will not usually be called by application code. To load media - in a template, use the @gr_tag{media_finder} template tag. - */ - QPair mediaUri(const QString &fileName) const; - - /** - Load the Template identified by @p name. - - The Templates and plugins loaded will be determined by - the **%Engine** configuration. - */ - Template loadByName(const QString &name) const; - - /** - Create a new Template with the content @p content identified by @p name. - - The secondary Templates and plugins loaded will be determined by - the **%Engine** configuration. - */ - Template newTemplate(const QString &content, const QString &name) const; - - /** - Returns the libraries available by default to new Templates. - */ - QStringList defaultLibraries() const; - - /** - Adds the library named @p libName to the libraries available by default to - new Templates. - */ - void addDefaultLibrary(const QString &libName); - - /** - Removes the library named @p libName from the libraries available by - default to new Templates. - */ - void removeDefaultLibrary(const QString &libName); - - /** - Returns whether the smart trim feature is enabled for newly loaded - templates. - - @see smart_trim - - This is false by default. - */ - bool smartTrimEnabled() const; - - /** - Sets whether the smart trim feature is enabled for newly loaded templates. - - @see smart_trim - */ - void setSmartTrimEnabled(bool enabled); - -#ifndef Q_QDOC - /** - @internal - - Loads and returns the libraries specified in defaultLibraries or @p state. - */ - void loadDefaultLibraries(); - - /** - @internal - - Loads and returns the library specified by @p name in the - current **%Engine** configuration or @p state. - - Templates wishing to load a library should use the @gr_tag{load} tag. - */ - TagLibraryInterface *loadLibrary(const QString &name); -#endif - -private: - Q_DECLARE_PRIVATE(Engine) - EnginePrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/exception.h b/qt6-after/qt6-migrated-legatus/include/grantlee/exception.h deleted file mode 100644 index 80bf2cf4f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/exception.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_EXCEPTION_H -#define GRANTLEE_EXCEPTION_H - -#include "grantlee_templates_export.h" - -#include - -#include - -namespace Grantlee -{ - -/** - Types of errors that can occur while using %Grantlee -*/ -enum Error { - NoError, - EmptyVariableError, - EmptyBlockTagError, - InvalidBlockTagError, - UnclosedBlockTagError, - UnknownFilterError, - TagSyntaxError, - // VariableSyntaxError, - - VariableNotInContext, - ObjectReturnTypeInvalid, - CompileFunctionError -}; - -/// @headerfile exception.h grantlee/exception.h - -/** - @brief An exception for use when implementing template tags. - - The **%Exception** class can be used when implementing - AbstractNodeFactory::getNode. An exception can be thrown to indicate that - the syntax of a particular tag is invalid. - - For example, the following template markup should throw an error because the - include tag should have exactly one argument: - - @code -
- {% include %} -
- @endcode - - The corresponding implementation of IncludeNodeFactory::getNode is - - @code - QStringList tagContents = smartSplit( tagContent ); - - if ( tagContents.size() != 2 ) - throw Grantlee::Exception( TagSyntaxError, - "Error: Include tag takes exactly one argument" ); - - // The item at index 0 in the list is the tag name, "include" - QString includeName = tagContents.at( 1 ); - @endcode - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT Exception -{ -public: - /** - Creates an exception for the error @p errorCode and the verbose - message @p what - */ - Exception(Error errorCode, const QString &what) - : m_errorCode(errorCode), m_what(what) - { - } - - virtual ~Exception() throw() {} - -#ifndef Q_QDOC - /** - @internal - - Returns the verbose message for the exception. - */ - const QString what() const throw() { return m_what; } - - /** - @internal - - Returns the error code for the exception. - */ - Error errorCode() const { return m_errorCode; } -#endif - -private: - Error m_errorCode; - QString m_what; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/filter.h b/qt6-after/qt6-migrated-legatus/include/grantlee/filter.h deleted file mode 100644 index 3a08efcbe..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/filter.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -// krazy:excludeall=dpointer - -#ifndef GRANTLEE_FILTER_H -#define GRANTLEE_FILTER_H - -#include "grantlee_templates_export.h" -#include "outputstream.h" -#include "safestring.h" - -#include -#include -#include - -namespace Grantlee -{ - -/// @headerfile filter.h grantlee/filter.h - -/** - @brief Base class for all filters. - - The **%Filter** class can be implemented in plugin libraries to make - additional functionality available to templates. - - Developers are required only to implement the @ref doFilter method and - integrate the filter as part of a custom plugin, but will never create or - access filters directly in application code. - - The FilterExpression class is the access interface to a chain of **%Filter** - objects. - - The @ref escape and @ref conditionalEscape methods are available for escaping - data where needed. - - @see @ref filters - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT Filter -{ -public: - /** - Destructor. - */ - virtual ~Filter(); - -#ifndef Q_QDOC - /** - FilterExpression makes it possible to access stream methods like escape - while resolving. - */ - void setStream(OutputStream *stream); -#endif - - /** - Escapes and returns @p input. The OutputStream::escape method is used to - escape @p input. - */ - SafeString escape(const QString &input) const; - - /** - Escapes and returns @p input. The OutputStream::escape method is used to - escape @p input. - */ - SafeString escape(const SafeString &input) const; - - /** - Escapes @p input if not already safe from further escaping and returns it. - The OutputStream::escape method is used to escape @p input. - */ - SafeString conditionalEscape(const SafeString &input) const; - - /** - Reimplement to filter @p input given @p argument. - - @p autoescape determines whether the autoescape feature is currently on or - off. Most filters will not use this. - - @see @ref autoescaping - */ - virtual QVariant doFilter(const QVariant &input, - const QVariant &argument = {}, - bool autoescape = {}) const = 0; - - /** - Reimplement to return whether this filter is safe. - */ - virtual bool isSafe() const; - -private: -#ifndef Q_QDOC - OutputStream *m_stream; -#endif -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/filterexpression.h b/qt6-after/qt6-migrated-legatus/include/grantlee/filterexpression.h deleted file mode 100644 index 796d36f6b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/filterexpression.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_FILTEREXPRESSION_H -#define GRANTLEE_FILTEREXPRESSION_H - -#include "variable.h" - -#include "grantlee_templates_export.h" - -namespace Grantlee -{ -class Filter; -class OutputStream; -class Parser; -struct Token; - -class FilterExpressionPrivate; - -/// @headerfile filterexpression.h grantlee/filterexpression.h - -/** - @brief A **%FilterExpression** object represents a filter expression in a - template. - - This class is only relevant if implementing custom tags or filters. Most of - the API here is internal. - Usually when implementing tags or filters, filter expressions will just be - created and resolved. - - In template markup, a filter expression is a variable followed by one or more - filters separated by pipes: - - %Filter expressions may appear in variable nodes: - @code - {{ some_var|upper_filter|lower_filter }} - @endcode - - Or as arguments to tags - @code - {% some_tag some_arg1|filter1|filter2 some_arg2|filter3 %} - @endcode - - The **%FilterExpression** class would be used in the getNode implementation of - the AbstractNodeFactory implementation for the some_tag tag. - - @code - Node* SomeTagFactory::getNode(const QString &tagContent, Parser *p) const { - auto parts = smartSplit( tagContent ); - - parts.removeFirst(); // Remove the "some_tag" part. - - FilterExpression arg1( parts.first(), p ); - FilterExpression arg2( parts.at( 1 ), p ); - - return new SomeTagNode( arg1, arg2, p ); - } - @endcode - - @see AbstractNodeFactory::getFilterExpressionList - - When implementing the Node::render method, the @ref resolve method may be used - to process the filter expression. - - For example, if our SomeTagNode was to concatenate the resolved - values given as arguments: - - @code - void SomeTagNode::render( QTextStream *stream, Context *c ) { - m_arg1.resolve( stream, c ); - m_arg2.resolve( stream, c ); - } - @endcode - - Because Filters are highly generic, they do not all write data to the stream. - For example, a Filter might take as input a string, and return a list by - splitting the string on commas, or a Filter might compare an input to its - argument and return whether they are the same, but not write anything to the - stream. For that reason, the @ref resolve method writes data to the given - stream, and returns the same data in its returned QVariant. - - The suitability of either of the @ref resolve methods will depend on the - implementation and requirements of your custom tag. For example if the - SomeTagNode ran a comparison of the arguments: - - @code - void SomeTagNode::render( QTextStream *stream, Context *c ) { - QString first = m_arg1.resolve( c ).toString(); - QString second = m_arg2.resolve( c ).toString(); - - if ( first == second ) - m_trueList.render( stream, c ); - else - m_falseList.render( stream, c ); - } - @endcode - - @see @ref tags_with_end_tags - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT FilterExpression -{ -public: - /** - Constructs an invalid **%FilterExpression**. - */ - FilterExpression(); - - /** - Constructs a filter expression from the string @p varString. The Parser @p - parser is used to retrieve filters. - */ - FilterExpression(const QString &varString, Grantlee::Parser *parser); - - /** - Copy constructor. - */ - FilterExpression(const FilterExpression &other); - - /** - Destructor. - */ - ~FilterExpression(); - - /** - Assignment operator. - */ - FilterExpression &operator=(const FilterExpression &other); - - /** - Returns the initial variable in the **%FilterExpression**. - */ - Variable variable() const; - - /** - Resolves the **%FilterExpression** in the Context @p c and writes it to the - stream @p stream. - */ - QVariant resolve(OutputStream *stream, Context *c) const; - - /** - Resolves the **%FilterExpression** in the Context @p c. - */ - QVariant resolve(Context *c) const; - - /** - Returns whether the Filter resolves to true in the Context @p c. - @see @ref truthiness - */ - bool isTrue(Context *c) const; - - /** - Returns a list for the **%FilterExpression**. - - If the **%FilterExpression** can not be resolved to a list, an empty list - will be returned. - */ - QVariantList toList(Context *c) const; - - /** - Returns whether a filter expression is valid. - - A **%FilterExpression** is valid if all filters in the expression exist and - the initial variable being filtered is valid. - */ - bool isValid() const; - -#ifndef Q_QDOC - /** - @internal - Returns the list of filters in the **%FilterExpression**. - */ - QStringList filters() const; -#endif - -private: - Q_DECLARE_PRIVATE(FilterExpression) - FilterExpressionPrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_templates_export.h b/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_templates_export.h deleted file mode 100644 index 1624c4b82..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_templates_export.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef GRANTLEE_TEMPLATES_EXPORT_H -#define GRANTLEE_TEMPLATES_EXPORT_H - -#ifdef GRANTLEE_TEMPLATES_STATIC_DEFINE -# define GRANTLEE_TEMPLATES_EXPORT -# define GRANTLEE_TEMPLATES_NO_EXPORT -#else -# ifndef GRANTLEE_TEMPLATES_EXPORT -# ifdef Grantlee_Templates_EXPORTS - /* We are building this library */ -# define GRANTLEE_TEMPLATES_EXPORT __attribute__((visibility("default"))) -# else - /* We are using this library */ -# define GRANTLEE_TEMPLATES_EXPORT __attribute__((visibility("default"))) -# endif -# endif - -# ifndef GRANTLEE_TEMPLATES_NO_EXPORT -# define GRANTLEE_TEMPLATES_NO_EXPORT __attribute__((visibility("hidden"))) -# endif -#endif - -#ifndef GRANTLEE_TEMPLATES_DEPRECATED -# define GRANTLEE_TEMPLATES_DEPRECATED __attribute__ ((__deprecated__)) -#endif - -#ifndef GRANTLEE_TEMPLATES_DEPRECATED_EXPORT -# define GRANTLEE_TEMPLATES_DEPRECATED_EXPORT GRANTLEE_TEMPLATES_EXPORT GRANTLEE_TEMPLATES_DEPRECATED -#endif - -#ifndef GRANTLEE_TEMPLATES_DEPRECATED_NO_EXPORT -# define GRANTLEE_TEMPLATES_DEPRECATED_NO_EXPORT GRANTLEE_TEMPLATES_NO_EXPORT GRANTLEE_TEMPLATES_DEPRECATED -#endif - -#if 0 /* DEFINE_NO_DEPRECATED */ -# ifndef GRANTLEE_TEMPLATES_NO_DEPRECATED -# define GRANTLEE_TEMPLATES_NO_DEPRECATED -# endif -#endif - -#endif /* GRANTLEE_TEMPLATES_EXPORT_H */ diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_textdocument_export.h b/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_textdocument_export.h deleted file mode 100644 index 63bf5e2f7..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_textdocument_export.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef GRANTLEE_TEXTDOCUMENT_EXPORT_H -#define GRANTLEE_TEXTDOCUMENT_EXPORT_H - -#ifdef GRANTLEE_TEXTDOCUMENT_STATIC_DEFINE -# define GRANTLEE_TEXTDOCUMENT_EXPORT -# define GRANTLEE_TEXTDOCUMENT_NO_EXPORT -#else -# ifndef GRANTLEE_TEXTDOCUMENT_EXPORT -# ifdef Grantlee_TextDocument_EXPORTS - /* We are building this library */ -# define GRANTLEE_TEXTDOCUMENT_EXPORT __attribute__((visibility("default"))) -# else - /* We are using this library */ -# define GRANTLEE_TEXTDOCUMENT_EXPORT __attribute__((visibility("default"))) -# endif -# endif - -# ifndef GRANTLEE_TEXTDOCUMENT_NO_EXPORT -# define GRANTLEE_TEXTDOCUMENT_NO_EXPORT __attribute__((visibility("hidden"))) -# endif -#endif - -#ifndef GRANTLEE_TEXTDOCUMENT_DEPRECATED -# define GRANTLEE_TEXTDOCUMENT_DEPRECATED __attribute__ ((__deprecated__)) -#endif - -#ifndef GRANTLEE_TEXTDOCUMENT_DEPRECATED_EXPORT -# define GRANTLEE_TEXTDOCUMENT_DEPRECATED_EXPORT GRANTLEE_TEXTDOCUMENT_EXPORT GRANTLEE_TEXTDOCUMENT_DEPRECATED -#endif - -#ifndef GRANTLEE_TEXTDOCUMENT_DEPRECATED_NO_EXPORT -# define GRANTLEE_TEXTDOCUMENT_DEPRECATED_NO_EXPORT GRANTLEE_TEXTDOCUMENT_NO_EXPORT GRANTLEE_TEXTDOCUMENT_DEPRECATED -#endif - -#if 0 /* DEFINE_NO_DEPRECATED */ -# ifndef GRANTLEE_TEXTDOCUMENT_NO_DEPRECATED -# define GRANTLEE_TEXTDOCUMENT_NO_DEPRECATED -# endif -#endif - -#endif /* GRANTLEE_TEXTDOCUMENT_EXPORT_H */ diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_version.h b/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_version.h deleted file mode 100644 index b3c110b29..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/grantlee_version.h +++ /dev/null @@ -1,7 +0,0 @@ -#define GRANTLEE_VERSION_MAJOR 5 -#define GRANTLEE_VERSION_MINOR 3 -#define GRANTLEE_VERSION_PATCH 0 -#define GRANTLEE_VERSION_STRING "5.3.0" -#define GRANTLEE_VERSION ((5<<16)|(3<<8)|(0)) -#define GRANTLEE_MAJOR_MINOR_VERSION_STRING "5.3" -#define GRANTLEE_MIN_PLUGIN_VERSION 0 diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/markupdirector.h b/qt6-after/qt6-migrated-legatus/include/grantlee/markupdirector.h deleted file mode 100644 index ca9daa1d5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/markupdirector.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_MARKUPDIRECTOR_H -#define GRANTLEE_MARKUPDIRECTOR_H - -#include "abstractmarkupbuilder.h" -#include "grantlee_textdocument_export.h" - -#include -#include - -class QTextTable; -class QTextTableCell; -class QTextList; -class QTextCharFormat; - -namespace Grantlee -{ - -class MarkupDirectorPrivate; - -/// @headerfile markupdirector.h grantlee/markupdirector.h - -/** - @brief Instructs a builder object to create markup output - - The **%MarkupDirector** is used with an implementation of - AbstractMarkupBuilder to create a marked up document output. - - Usage can be quite simple. - - @code - auto doc = editor->document(); // editor is a QTextEdit - - auto builder = new HTMLBuilder(); - auto md = new MarkupDirector(builder); - md->processDocument(doc); - browser->setHtml(builder->getResult()); // browser is a QTextBrowser. - @endcode - - Or with a different builder: - - @code - auto builder = new PlainTextMarkupBuilder(); - auto md = new MarkupDirector(builder); - md->processDocument(doc); - browser->setPlainText(builder->getResult()); - @endcode - - The **%MarkupDirector** also provides API for processing just part of a - QTextDocument, such as a QTextFrame or a QTextBlock. The appropriate method - may then be called with an invalid iterator as appropriate. - - @code - // ... Do some processing to get a QTextFrame. - auto frame = getFrame(); - - auto builder = new PlainTextMarkupBuilder(); - auto md = new MarkupDirector(builder); - - // Create output from only the frame. - md->processFrame(QTextFrame::iterator(), frame); - browser->setPlainText(builder->getResult()); - @endcode - - The behaviour of the **%MarkupDirector** can be customized by subclassing. - Support for custom types can also be added by implementing the @ref - processCustomFragment method. - - @see @ref custom_qtextobject - - @author Stephen Kelly -*/ -class GRANTLEE_TEXTDOCUMENT_EXPORT MarkupDirector -{ -public: - /** - Constructor - */ - MarkupDirector(AbstractMarkupBuilder *builder); - - /** - Destructor - */ - virtual ~MarkupDirector(); - - /** - Constructs the output by directing the builder to create the markup. - */ - virtual void processDocument(QTextDocument *doc); - - /** - Directs the builder to create output for the single @p frame. If calling - this method directly, an invalid QTextFrame::iterator may be used. - */ - virtual QTextFrame::iterator processFrame(QTextFrame::iterator it, - QTextFrame *frame); - - /** - Directs the builder to create output for the single @p block. If calling - this method directly, an invalid QTextFrame::iterator may be used. - - This method does not process the contents of the @p block, but uses the - @ref processBlockContents method to do so. - */ - virtual QTextFrame::iterator processBlock(QTextFrame::iterator it, - const QTextBlock &block); - - /** - Directs the builder to create output for the single @p textObject. If - calling this method directly, an invalid QTextFrame::iterator may be used. - - The block @p block is the container of the @p textObject. - */ - virtual QTextFrame::iterator processObject(QTextFrame::iterator it, - const QTextBlock &block, - QTextObject *textObject); - - /** - Directs the builder to create output for the single @p textBlockGroup. If - calling this method directly, an invalid QTextFrame::iterator may be used. - - The block @p block is the first block in the @p textBlockGroup. - */ - virtual QPair - processBlockGroup(QTextFrame::iterator it, const QTextBlock &block, - QTextBlockGroup *textBlockGroup); - - /** - Directs the builder to create output for the single @p textList. If - calling this method directly, an invalid QTextFrame::iterator may be used. - - The block @p block is the first block in the @p textList. - */ - virtual QPair - processList(QTextFrame::iterator it, const QTextBlock &block, - QTextList *textList); - - /** - Directs the builder to create output for the contents of the single @p - block. If calling this method directly, an invalid QTextFrame::iterator - may be used. - */ - virtual QTextFrame::iterator processBlockContents(QTextFrame::iterator it, - const QTextBlock &block); - - /** - Hook for instructing the builder to create output for the @p fragemnt with - a custom type. @p doc is the document the fragment is in. - */ - virtual void processCustomFragment(const QTextFragment &fragment, - QTextDocument const *doc); - - /** - Directs the builder to create output for the contents of the single @p - fragment. If calling this method directly, an invalid QTextBlock::iterator - may be used. @p doc is the document the fragment is in. - */ - virtual QTextBlock::iterator processFragment(QTextBlock::iterator it, - const QTextFragment &fragment, - QTextDocument const *doc); - - /** - Directs the builder to create output for the contents of the single @p - textObject. The @p textObject is represented in the QTextDocument with the - QTextFragment @p fragment. - - If calling this method directly, an invalid QTextBlock::iterator may be - used. - */ - virtual QTextBlock::iterator - processCharTextObject(QTextBlock::iterator it, const QTextFragment &fragment, - QTextObject *textObject); - - /** - Directs the builder to create output for the image represented by the @p - imageFormat. - - If calling this method directly, an invalid QTextBlock::iterator may be - used. @p doc is the document the fragment is in. - */ - virtual QTextBlock::iterator processImage(QTextBlock::iterator it, - const QTextImageFormat &imageFormat, - QTextDocument *doc); - - /** - Directs the builder to create output for the contents of the single @p - table. - - If calling this method directly, an invalid QTextFrame::iterator may be - used. - */ - virtual QTextFrame::iterator processTable(QTextFrame::iterator it, - QTextTable *table); - - /** - Directs the builder to create output for the contents of the single @p - tableCell. The tableCell is in the @p table. - */ - virtual void processTableCell(const QTextTableCell &tableCell, - QTextTable *table); - -protected: - /** - Processes the document between @p begin and @p end - */ - void processDocumentContents(QTextFrame::iterator begin, - QTextFrame::iterator end); - - /** - Iterates the iterator @p it to the first block after @p blockGroup. @p - _block is any block in the @p blockGroup. - - The return pair is the iterator pointing after the end of @p blockGroup - and the first block after @p blockGroup. - */ - QPair - skipBlockGroup(QTextFrame::iterator it, const QTextBlock &_block, - QTextBlockGroup *blockGroup); - - /** - Returns a list of tags contained in @p openingTags sorted so they can be - opened in order and will be closed in the correct order. - - @p openingTags should be a set of tags opened at the fragment pointed to - by @p it. - */ - QList sortOpeningOrder(QSet openingTags, - QTextBlock::iterator it) const; - - /** - Directs the builder to close the appropriate tags at the position of @p - it. - */ - virtual void processClosingElements(QTextBlock::iterator it); - - /** - Directs the builder to open the appropriate tags at the position of @p it. - */ - virtual void processOpeningElements(QTextBlock::iterator it); - - /** - Returns the tags that should be closed at the position of @p it. - */ - virtual QSet getElementsToClose(QTextBlock::iterator it) const; - - /** - Returns the tags that should be opened at the position of @p it. - */ - virtual QList getElementsToOpen(QTextBlock::iterator it); - - /** - Flags for the tags that may be open. - */ - enum OpenElementValues { - None = 0x0, /// No tags are open - SuperScript = 0x01, /// A superscript tag is open - SubScript = 0x02, /// A subscript tag is open - Anchor = 0x04, /// An anchor tag is open - SpanForeground = 0x08, /// A foreground altering span tag is open. - SpanBackground = 0x10, /// A background altering span tag is open. - SpanFontFamily = 0x20, /// A font family altering span tag is open. - SpanFontPointSize = 0x40, /// A font size altering span tag is open. - Strong = 0x80, /// A strong tag is open. - Emph = 0x100, /// A emphasis tag is open. - Underline = 0x200, /// An underline tag is open. - StrikeOut = 0x400 /// A strikeout tag is open. - }; - -protected: -#ifndef Q_QDOC - MarkupDirectorPrivate *const d_ptr; -#endif - - /** - The builder this MarkupDirector is operating on. This is available when - subclassing to customize behaviour. - */ - AbstractMarkupBuilder *m_builder; - -#ifndef Q_QDOC -private: - Q_DECLARE_PRIVATE(MarkupDirector) -#endif -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/mediawikimarkupbuilder.h b/qt6-after/qt6-migrated-legatus/include/grantlee/mediawikimarkupbuilder.h deleted file mode 100644 index ec8652886..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/mediawikimarkupbuilder.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_MEDIAWIKIMARKUPBUILDER_H -#define GRANTLEE_MEDIAWIKIMARKUPBUILDER_H - -#include "abstractmarkupbuilder.h" - -namespace Grantlee -{ - -/** - @brief Creates MediaWiki markup from a QTextDocument -*/ -class MediaWikiMarkupBuilder : public AbstractMarkupBuilder -{ -public: - MediaWikiMarkupBuilder(); - ~MediaWikiMarkupBuilder() override; - - void beginStrong() override; - void endStrong() override; - void beginEmph() override; - void endEmph() override; - void beginUnderline() override; - void endUnderline() override; - void beginStrikeout() override; - void endStrikeout() override; - - void endParagraph() override; - void addNewline() override; - - void beginAnchor(const QString &href = {}, const QString &name = {}) override; - void endAnchor() override; - - void beginHeader(int level) override; - void endHeader(int level) override; - - void beginList(QTextListFormat::Style type) override; - - void endList() override; - - void beginListItem() override; - void endListItem() override; - - void appendLiteralText(const QString &text) override; - - /** - Escapes @p text appropriately for MediaWiki. - */ - const QString escape(const QString &s); - - QString getResult() override; - -private: - QList currentListItemStyles; - - QString m_text; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/metatype.h b/qt6-after/qt6-migrated-legatus/include/grantlee/metatype.h deleted file mode 100644 index e4fc48df8..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/metatype.h +++ /dev/null @@ -1,244 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2010 Michael Jansen - Copyright (c) 2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_METATYPE_H -#define GRANTLEE_METATYPE_H - -#include "grantlee_templates_export.h" - -#include "typeaccessor.h" - -#include - -/// @file - -namespace Grantlee -{ - -/// @headerfile metatype.h grantlee/metatype.h - -#ifndef Q_QDOC -/** - @brief The **%MetaType** is the interface to the Grantlee introspection - system. - - The **%MetaType** class is used as part of the type registration system of - %Grantlee. - - @see @ref generic_types_and_templates - @author Michael Jansen - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT MetaType -{ -public: - /** - @internal The signature for a property lookup method - */ - typedef QVariant (*LookupFunction)(const QVariant &, const QString &); - - /** - @internal Registers a property lookup method - */ - static void registerLookUpOperator(int id, LookupFunction f); - - /** - @internal - */ - static void internalLock(); - - /** - @internal - */ - static void internalUnlock(); - - /** - @internal - */ - static QVariant lookup(const QVariant &object, const QString &property); - - /** - @internal - */ - static bool lookupAlreadyRegistered(int id); - -private: - MetaType(); -}; -#endif - -namespace -{ - -/* - This is a helper to select an appropriate overload of indexAccess - */ -template struct LookupTrait { - static QVariant doLookUp(const QVariant &object, const QString &property) - { - typedef typename Grantlee::TypeAccessor Accessor; - return Accessor::lookUp(object.value(), property); - } -}; - -template -struct LookupTrait { - static QVariant doLookUp(const QVariant &object, const QString &property) - { - typedef typename Grantlee::TypeAccessor Accessor; - return Accessor::lookUp(object.value(), property); - } -}; - -template static int doRegister(int id) -{ - if (MetaType::lookupAlreadyRegistered(id)) - return id; - - QVariant (*lf)(const QVariant &, const QString &) - = LookupTrait::doLookUp; - - MetaType::registerLookUpOperator( - id, reinterpret_cast(lf)); - - return id; -} - -/* - Register a type so grantlee knows how to handle it. - */ -template struct InternalRegisterType { - static int doReg() - { - const int id = qMetaTypeId(); - return doRegister(id); - } -}; - -template -struct InternalRegisterType { - static int doReg() - { - const int id = qMetaTypeId(); - return doRegister(id); - } -}; -} - -/** - @brief Registers the type RealType with the metatype system. - - This method can take a second template parameter to specify a cast - that should be invoked during registration. This is useful if a base type is - already supported. - - @code - class SomeType - { - public: - QString someProp() const; - }; - - // define some introspectable API for SomeType - - GRANTLEE_BEGIN_LOOKUP(SomeType) - if (property == "someProp") - return object.someProp(); - GRANTLEE_END_LOOKUP - - - class OtherType : public SomeType - { - // ... - }; - - registerMetaType(); - - // Only the introspectable API from SomeType is needed, so we can reuse that - registration. - registerMetaType(); - @endcode - - @see @ref generic_types_and_templates - */ -template int registerMetaType() -{ - MetaType::internalLock(); - - const int id = InternalRegisterType::doReg(); - - MetaType::internalUnlock(); - - return id; -} - -#ifndef Q_QDOC -/** - @internal - Register a type so %Grantlee knows how to handle it. - - This is a convenience method. - */ -template int registerMetaType() -{ - return registerMetaType(); -} - -#endif -} // namespace Grantlee - -/** - Top boundary of a lookup function for Type. - - @see @ref generic_types - */ -#define GRANTLEE_BEGIN_LOOKUP(Type) \ - namespace Grantlee \ - { \ - template <> \ - inline QVariant TypeAccessor::lookUp(const Type &object, \ - const QString &property) \ - { - -/** - Top boundary of a lookup function for Type*. - - @see @ref generic_types - */ -#define GRANTLEE_BEGIN_LOOKUP_PTR(Type) \ - namespace Grantlee \ - { \ - template <> \ - inline QVariant TypeAccessor::lookUp(const Type *const object, \ - const QString &property) \ - { - -/** - Bottom boundary of a lookup function for Type. - - @see @ref generic_types - */ -#define GRANTLEE_END_LOOKUP \ - return QVariant(); \ - } \ - } - -#endif // #define GRANTLEE_METATYPE_H diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/node.h b/qt6-after/qt6-migrated-legatus/include/grantlee/node.h deleted file mode 100644 index 56be517b4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/node.h +++ /dev/null @@ -1,380 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_NODE_H -#define GRANTLEE_NODE_H - -// krazy:excludeall=dpointer - -#include "context.h" -#include "filterexpression.h" -#include "grantlee_templates_export.h" -#include "outputstream.h" -#include "safestring.h" - -#include - -// Need these for inheriting from QList to work -// http://lists.trolltech.com/qt-interest/2008-01/thread00578-0.html -#include -#include - -namespace Grantlee -{ - -class Engine; -class NodeList; -class TemplateImpl; - -class NodePrivate; - -/// @headerfile node.h grantlee/node.h - -/** - @brief Base class for all nodes. - - The **%Node** class can be implemented to make additional functionality - available to Templates. - - A node is represented in template markup as content surrounded by percent - signed tokens. - - @code - text content - {% some_tag arg1 arg2 %} - text content - {% some_other_tag arg1 arg2 %} - text content - {% end_some_other_tag %} - text content - @endcode - - This is parsed into a tree of **%Node** objects by an implementation of - AbstractNodeFactory. The **%Node** objects can then later be rendered by their - @ref render method. - - Rendering a **%Node** will usually mean writing some output to the stream. The - content written to the stream could be determined by the arguments to the tag, - or by the content of child nodes between a start and end tag, or both. - - @see FilterExpression - @see @ref tags - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT Node : public QObject -{ - Q_OBJECT -public: - /** - Constructor. - - @param parent The parent QObject - */ - explicit Node(QObject *parent = {}); - - /** - Destructor. - */ - ~Node() override; - - /** - Reimplement this to render the template in the Context @p c. - - This will also involve calling render on and child nodes. - */ - virtual void render(OutputStream *stream, Context *c) const = 0; - -#ifndef Q_QDOC - /** - @internal - */ - virtual bool mustBeFirst() - { // krazy:exclude:inline - return false; - } -#endif - -protected: - /** - Renders the value @p input in the Context @p c. This will involve escaping - @p input if necessary. - - This is only relevant to developing template tags. - */ - void streamValueInContext(OutputStream *stream, const QVariant &input, - Grantlee::Context *c) const; - - /** - Returns a raw pointer to the Template this **%Node** is in. - */ - TemplateImpl *containerTemplate() const; - -private: - Q_DECLARE_PRIVATE(Node) - NodePrivate *const d_ptr; -}; - -/// @headerfile node.h grantlee/node.h - -/** - @brief A list of Nodes with some convenience API for rendering them. - - Typically, tags which have an end tag will create and later render a list of - child nodes. - - This class contains API such as @ref append and @ref render to make creating - such list easily. - - The @ref findChildren method behaves similarly to the QObject::findChildren - method, returning a list of nodes of a particular type from the Node objects - contained in the list (and their children). - - @see @ref tags_with_end_tags -*/ -class GRANTLEE_TEMPLATES_EXPORT NodeList : public QList -{ -public: - /** - Creates an empty **%NodeList**. - */ - NodeList(); - - /** - Copy constructor. - */ - NodeList(const NodeList &list); - - NodeList &operator=(const NodeList &list); - - /** - Convenience constructor - */ - /* implicit */ NodeList(const QList &list); - - /** - Destructor. - */ - ~NodeList(); - - /** - Appends @p node to the end of this **%NodeList**. - */ - void append(Grantlee::Node *node); - - /** - Appends @p nodeList to the end of this **%NodeList**. - */ - void append(QList nodeList); - - /** - Returns true if this **%NodeList** contains non-text nodes. - */ - bool containsNonText() const; - - /** - A recursive listing of nodes in this tree of type @p T. - */ - template QList findChildren() - { - QList children; - QList::const_iterator it; - const QList::const_iterator first = constBegin(); - const QList::const_iterator last = constEnd(); - for (it = first; it != last; ++it) { - T object = qobject_cast(*it); - if (object) { - children << object; - } - children << (*it)->findChildren(); - } - return children; - } - - /** - Renders the list of Nodes in the Context @p c. - */ - void render(OutputStream *stream, Context *c) const; - -private: - bool m_containsNonText; -}; - -class AbstractNodeFactoryPrivate; - -/// @headerfile node.h grantlee/node.h - -/** - @brief Base class for all NodeFactories - - This class can be used to make custom tags available to templates. - The getNode method should be implemented to return a Node to be rendered. - - A node is represented in template markup as content surrounded by percent - signed tokens. - - @code - text content - {% some_tag arg1 arg2 %} - text content - {% some_other_tag arg1 arg2 %} - text content - {% end_some_other_tag %} - text content - @endcode - - It is the responsibility of an **%AbstractNodeFactory** implementation to - process the contents of a tag and return a Node implementation from its - getNode method. - - The @ref getNode method would for example be called with the tagContent - \"some_tag arg1 arg2\". That content could then be split up, the - arguments processed and a Node created - - @code - Node* SomeTagFactory::getNode(const QString &tagContent, Parser *p) { - QStringList parts = smartSplit( tagContent ); - - parts.removeFirst(); // Remove the "some_tag" part. - - FilterExpression arg1( parts.first(), p ); - FilterExpression arg2( parts.at( 1 ), p ); - - return new SomeTagNode( arg1, arg2, p ); - } - @endcode - - The @ref getNode implementation might also advance the parser. For example if - we had a @gr_tag{times} tag which rendered content the amount of times it was - given in its argument, it could be used like this: - - @code - Some text content. - {% times 5 %} - the bit to be repeated - {% end_times %} - End text content - @endcode - - The argument to @gr_tag{times} might not be a simple number, but could be a - FilterExpression such as \"someobject.some_property|getDigit:1\". - - The implementation could look like - - @code - Node* SomeOtherTagFactory::getNode(const QString &tagContent, Parser *p) { - QStringList parts = smartSplit( tagContent ); - - parts.removeFirst(); // Remove the "times" part. - - FilterExpression arg( parts.first(), p ); - - auto node = new SomeTagNode( arg, p ); - auto childNodes = p->parse( node, "end_times" ); - node->setChildNodes( childNodes ); - p->removeNextToken(); - - return node; - } - @endcode - - Note that it is necessary to invoke the parser to create the child nodes only - after creating the Node to return. That node must be passed to the Parser to - perform as the parent QObject to the child nodes. - - @see Parser::parse -*/ -class GRANTLEE_TEMPLATES_EXPORT AbstractNodeFactory : public QObject -{ - Q_OBJECT -public: - /** - Constructor. - - @param parent The parent QObject - */ - explicit AbstractNodeFactory(QObject *parent = {}); - - /** - Destructor. - */ - ~AbstractNodeFactory() override; - - /** - This method should be reimplemented to return a Node which can be - rendered. - - The @p tagContent is the content of the tag including the tag name and - arguments. For example, if the template content is @gr_tag{my_tag arg1 - arg2}, the tagContent will be "my_tag arg1 arg2". - - The Parser @p p is available and can be advanced if appropriate. For - example, if the tag has an end tag, the parser can be advanced to the end - tag. - - @see tags - */ - virtual Node *getNode(const QString &tagContent, Parser *p) const = 0; - -#ifndef Q_QDOC - /** - @internal - - Sets the Engine which created this NodeFactory. Used by the - ScriptableNodeFactory. - */ - virtual void setEngine(Engine *) {} -#endif - -protected: - /** - Splits @p str into a list, taking quote marks into account. - - This is typically used in the implementation of getNode with the - tagContent. - - If @p str is 'one "two three" four 'five " six' seven', the - returned list will contain the following strings: - - - one - - "two three" - - four - - five " six - - seven - */ - Q_INVOKABLE QStringList smartSplit(const QString &str) const; - -protected: - /** - Returns a list of FilterExpression objects created with Parser @p p as - described by the content of @p list. - - This is used for convenience when handling the arguments to a tag. - */ - QList getFilterExpressionList(const QStringList &list, - Parser *p) const; - -private: - Q_DECLARE_PRIVATE(AbstractNodeFactory) - AbstractNodeFactoryPrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/outputstream.h b/qt6-after/qt6-migrated-legatus/include/grantlee/outputstream.h deleted file mode 100644 index d8cb6a46b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/outputstream.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_OUTPUTSTREAM_H -#define GRANTLEE_OUTPUTSTREAM_H - -#include "grantlee_templates_export.h" - -#include -#include - -namespace Grantlee -{ - -class SafeString; - -/// @headerfile outputstream.h grantlee/outputstream.h - -/** - @brief The **%OutputStream** class is used to render templates to a - QTextStream - - A **%OutputStream** instance may be passed to the render method of a Template - to render the template to a stream. - - @code - QFile outputFile("./output"); - outputFile.open(QFile::WriteOnly); - QTextStream tstream( &outputFile ); - - OutputStream os(&tstream); - t->render( &os, &context ); - @endcode - - The **%OutputStream** is used to escape the content streamed to it. By - default, the escaping is html escaping, converting "&" to "&" for example. - If generating non-html output, the @ref escape method may be overriden to - perform a different escaping, or non at all. - - If overriding the @ref escape method, the @ref clone method must also be - overriden to return an **%OutputStream** with the same escaping behaviour. - - @code - class NoEscapeStream : public Grantlee::OutputStream - { - public: - // ... - - QString escape( const QString &input ) const - { - return input; - } - - QSharedPointer clone( QTextStream *stream ) const - { - return QSharedPointer::create( stream ); - } - }; - @endcode - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT OutputStream -{ -public: - /** - Creates a null **%OutputStream**. Content streamed to - this **%OutputStream** is sent to /dev/null - */ - OutputStream(); - - /** - Creates an **%OutputStream** which will stream content to @p stream - with appropriate escaping. - */ - explicit OutputStream(QTextStream *stream); - - /** - Destructor - */ - virtual ~OutputStream(); - - /** - Returns an escaped version of @p input. Does not write anything to the - stream. - */ - virtual QString escape(const QString &input) const; - - /** - Returns an escaped version of @p input. Does not write anything to the - stream. - */ - QString escape(const SafeString &input) const; - - /** - Returns a cloned **%OutputStream** with the same filtering behaviour. - */ - virtual QSharedPointer clone(QTextStream *stream) const; - - /** - Returns @p after escaping it, unless @p input is "safe", in which case, - @p input is returned unmodified. - */ - QString conditionalEscape(const Grantlee::SafeString &input) const; - - /** - Writes @p input to the stream after escaping it. - */ - OutputStream &operator<<(const QString &input); - - /** - Writes @p input to the stream after escaping it if necessary. - */ - OutputStream &operator<<(const SafeString &input); - - /** - Reads the content of @p stream and writes it unmodified to the result - stream. - */ - OutputStream &operator<<(QTextStream *stream); - -private: - QTextStream *m_stream; - Q_DISABLE_COPY(OutputStream) -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/parser.h b/qt6-after/qt6-migrated-legatus/include/grantlee/parser.h deleted file mode 100644 index 3e54aeb70..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/parser.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_PARSER_H -#define GRANTLEE_PARSER_H - -#include "filter.h" -#include "node.h" -#include "token.h" - -#include - -namespace Grantlee -{ -class TemplateImpl; - -class ParserPrivate; - -/// @headerfile parser.h grantlee/parser.h - -/** - @brief The **%Parser** class processes a string template into a tree of nodes. - - For application developers, this class is internal. - - For template tag authors it may be necessary to advance the parser and process - contained tags if the tag works in a tag -- endtag fashion. - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT Parser : public QObject -{ - Q_OBJECT -public: - /** - Constructor. - - Initialises the **%Parser** with the @p tokenList. - */ - Parser(const QList &tokenList, QObject *parent); - - /** - Destructor. - */ - ~Parser() override; - - /** - Advance the parser, using @p parent as the parent of new Nodes. The parser - will stop if it encounters a tag which is contained in the list @p stopAt. - - For example, the @gr_tag{if} tag would stopAt both @gr_tag{endif} and - @gr_tag{else} tags. - - @see AbstractNodeFactory::getNode - */ - NodeList parse(Node *parent, const QStringList &stopAt = {}); - - /** - This is an overloaded method. - @see parse. - */ - NodeList parse(TemplateImpl *parent, const QStringList &stopAt = {}); - - /** - This is an overloaded method. - @see parse. - */ - NodeList parse(Node *parent, const QString &stopAt); - - /** - Returns the filter object called @p name or an invalid object if no filter - with that name is loaded. - */ - QSharedPointer getFilter(const QString &name) const; - - /** - Advances the parser to the tag @p tag. This method is similar to @ref parse, - but it does not create nodes for tags encountered. - */ - void skipPast(const QString &tag); - - /** - Returns the next token to be processed by the parser. This can be examined - in template tag implementations to determine why parsing stopped. - - For example, if the @gr_tag{if} tag, parsing may stop at an @gr_tag{else} - tag, in which case parsing should be restarted, or it could stop at an - @gr_tag{endif} tag, in which case parsing is finished for that node. - */ - Token takeNextToken(); - - /** - Returns whether the parser has another token to process. - */ - bool hasNextToken() const; - - /** - Deletes the next token available to the parser. - */ - void removeNextToken(); - - void invalidBlockTag(const Token &token, const QString &command, - const QStringList &stopAt = {}); - -#ifndef Q_QDOC - /** - @internal - - Used by the @gr_tag{load} tag to load libraries. - */ - void loadLib(const QString &name); -#endif - -protected: - /** - Puts the token @p token to the front of the list to be processed by the - parser. - */ - void prependToken(const Token &token); - -private: - Q_DECLARE_PRIVATE(Parser) - ParserPrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/plaintextmarkupbuilder.h b/qt6-after/qt6-migrated-legatus/include/grantlee/plaintextmarkupbuilder.h deleted file mode 100644 index bee0dfc8a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/plaintextmarkupbuilder.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_PLAINTEXTMARKUPBUILDER_H -#define GRANTLEE_PLAINTEXTMARKUPBUILDER_H - -#ifdef Q_OS_WIN -#pragma warning(disable : 4250) -#endif - -#define LETTERSINALPHABET 26 -#define DIGITSOFFSET 10 - -#include "abstractmarkupbuilder.h" -#include "grantlee_textdocument_export.h" -#include "markupdirector.h" - -class QBrush; - -namespace Grantlee -{ - -class PlainTextMarkupBuilderPrivate; - -/// @headerfile plaintextmarkupbuilder.h grantlee/plaintextmarkupbuilder.h - -/** - @brief Creates a simple marked up plain text document - - This class creates a simple plain text markup. - - Text that may be represented as - - @code - A paragraph with bold text, italic text, - and underlined text. - @endcode - - would be output as - - @code - A paragraph with *bold* text /italic/ text, - and _underlined_ text. - @endcode - - The markup is intended to be simple, plain and easily human readable. No - markup is created for different font-familiy, font-size, foreground or - background colors. - - Lists are marked up by preceding the list element with '*' for disc, 'o' for - circle, 'X' for square, or a letter or number. Lists are also indented if - nested. eg: - - @code - A. One - B. Two - o Three - o Four - \* Five - \* Six - C. Seven - @endcode - - External references such as external urls and images are represented in the - body text as a reference, and references are maintained at the bottom of the - output. - - Eg, - @code - Here is a link to KDE and - the KDEPIM project. - @endcode - - becomes: - - @code - Here is a link to KDE[1], and - the KDEPIM project[2]. - - ---- References ---- - [1] http://www.kde.org - [2] http://pim.kde.org - @endcode - - @author Stephen Kelly -*/ -class GRANTLEE_TEXTDOCUMENT_EXPORT PlainTextMarkupBuilder - : virtual public AbstractMarkupBuilder -{ -public: - PlainTextMarkupBuilder(); - - ~PlainTextMarkupBuilder() override; - - void beginStrong() override; - void endStrong() override; - void beginEmph() override; - void endEmph() override; - void beginUnderline() override; - void endUnderline() override; - void beginStrikeout() override; - void endStrikeout() override; - - void beginAnchor(const QString &href = {}, const QString &name = {}) override; - - void endAnchor() override; - - void beginForeground(const QBrush &brush) override; - - void endForeground() override; - - void beginBackground(const QBrush &brush) override; - - void endBackground() override; - - void beginFontFamily(const QString &family) override; - - void endFontFamily() override; - - void beginFontPointSize(int size) override; - - void endFontPointSize() override; - - void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0, - qreal bottom = 0.0, qreal left = 0.0, - qreal right = 0.0) override; - - void endParagraph() override; - void addNewline() override; - - void insertHorizontalRule(int width = -1) override; - - void insertImage(const QString &src, qreal width, qreal height) override; - - void beginList(QTextListFormat::Style style) override; - - void endList() override; - - void beginListItem() override; - - void endListItem() override; - - void beginSuperscript() override; - - void endSuperscript() override; - - void beginSubscript() override; - - void endSubscript() override; - - void beginTable(qreal cellpadding, qreal cellspacing, - const QString &width) override; - - void beginTableRow() override; - - void beginTableHeaderCell(const QString &width, int colSpan, - int rowSpan) override; - - void beginTableCell(const QString &width, int colSpan, int rowSpan) override; - - void endTable() override; - - void endTableRow() override; - - void endTableHeaderCell() override; - - void endTableCell() override; - - void beginHeader(int level) override; - - void endHeader(int level) override; - - void appendLiteralText(const QString &text) override; - - void appendRawText(const QString &text) override; - - /** - Adds a reference to @p reference to the internal list of references in the - document. - */ - int addReference(const QString &reference); - - /** - Returns the finalised plain text markup, including references at the end. - */ - QString getResult() override; - -private: - PlainTextMarkupBuilderPrivate *const d_ptr; - Q_DECLARE_PRIVATE(PlainTextMarkupBuilder) -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/qtlocalizer.h b/qt6-after/qt6-migrated-legatus/include/grantlee/qtlocalizer.h deleted file mode 100644 index 4d8ecdb4d..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/qtlocalizer.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_QTLOCALIZER_P_H -#define GRANTLEE_QTLOCALIZER_P_H - -#include "abstractlocalizer.h" - -class QTranslator; - -namespace Grantlee -{ - -class QtLocalizerPrivate; - -/** - @brief Provides internationalization based on QLocale and QTranslator. - - This class implements access to the %Qt Localization system. Localizable - types such as strings, numbers, dates and times can be processed. - - @code - auto t = m_engine->loadTemplate(someTemplate); - auto c = getContext(); - - // Render with the German locale - c.setLocalizer(m_de_Localizer); - auto deText = t->render(&c); - de_display->setText(deText); - - // Render with the French locale - c.setLocalizer(m_fr_Localizer); - auto frText = t->render(&c); - fr_display->setText(frText); - @endcode - -*/ -class GRANTLEE_TEMPLATES_EXPORT QtLocalizer : public AbstractLocalizer -{ -public: - /** - Constructs a new **%QtLocalizer** using the @p locale - */ - QtLocalizer(const QLocale &locale = QLocale::system()); - - /** - Destructor - */ - ~QtLocalizer() override; - - /** - Set the path to look for translations of the application strings. - */ - void setAppTranslatorPath(const QString &path); - - /** - Set the prefix of translation files. For example, if the German translation - file is called myapp_de_DE.qm, the prefix should be set to - myapp_. - */ - void setAppTranslatorPrefix(const QString &prefix); - - /** - Install a @p translator to use for a particular @p localeName. - - @code - auto deTranslator = new QTranslator(this); - auto loaded = deTranslator->load("myapp_de_DE"); - if (!loaded) - return; - - de_localizer->installTranslator(deTranslator, "de_DE"); - @endcode - */ - void installTranslator(QTranslator *translator, - const QString &localeName = QLocale::system().name()); - - QString currentLocale() const override; - void pushLocale(const QString &localeName) override; - void popLocale() override; - void loadCatalog(const QString &path, const QString &catalog) override; - void unloadCatalog(const QString &catalog) override; - - QString localizeNumber(int number) const override; - QString localizeNumber(qreal number) const override; - QString localizeMonetaryValue(qreal value, const QString ¤cyCode - = {}) const override; - QString localizeDate(const QDate &date, - QLocale::FormatType formatType - = QLocale::ShortFormat) const override; - QString localizeTime(const QTime &time, - QLocale::FormatType formatType - = QLocale::ShortFormat) const override; - QString localizeDateTime(const QDateTime &dateTime, - QLocale::FormatType formatType - = QLocale::ShortFormat) const override; - QString localizeString(const QString &string, - const QVariantList &arguments = {}) const override; - QString localizeContextString(const QString &string, const QString &context, - const QVariantList &arguments - = {}) const override; - QString localizePluralContextString(const QString &string, - const QString &pluralForm, - const QString &context, - const QVariantList &arguments - = {}) const override; - QString localizePluralString(const QString &string, const QString &pluralForm, - const QVariantList &arguments - = {}) const override; - -private: - Q_DECLARE_PRIVATE(QtLocalizer) - Q_DISABLE_COPY(QtLocalizer) - QtLocalizerPrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/rendercontext.h b/qt6-after/qt6-migrated-legatus/include/grantlee/rendercontext.h deleted file mode 100644 index 315102212..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/rendercontext.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_RENDERCONTEXT_H -#define GRANTLEE_RENDERCONTEXT_H - -#include "grantlee_templates_export.h" - -#include - -/// @headerfile rendercontext.h grantlee/rendercontext.h - -namespace Grantlee -{ - -class ContextPrivate; -class TemplateImpl; -class Node; - -class RenderContextPrivate; - -/** - @brief Provides storage facility for state while rendering a template. - - This class can not be instatiated by users of it. An instance - of **%RenderContext** is available through Context::renderContext() for use - with implementations of re-entrant template tags. - */ -class GRANTLEE_TEMPLATES_EXPORT RenderContext -{ -public: - /** - Returns the data for the node @p scopeNode. - */ - QVariant &data(const Node *const scopeNode); - - /** - Returns whether the **%RenderContext** contains data for @p scopeNode. - */ - bool contains(Node *const scopeNode) const; - - /** - Destructor - */ - ~RenderContext(); - -#ifndef Q_QDOC -private: - RenderContext(); - - void push(); - - void pop(); - -private: - friend class ContextPrivate; - friend class TemplateImpl; - - Q_DISABLE_COPY(RenderContext) - Q_DECLARE_PRIVATE(RenderContext) - RenderContextPrivate *const d_ptr; -#endif -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/safestring.h b/qt6-after/qt6-migrated-legatus/include/grantlee/safestring.h deleted file mode 100644 index 40f136440..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/safestring.h +++ /dev/null @@ -1,436 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_SAFESTRING_H -#define GRANTLEE_SAFESTRING_H - -#include "grantlee_templates_export.h" - -#include -#include - -namespace Grantlee -{ - -/// @headerfile safestring.h grantlee/safestring.h - -/** - @brief A QString wrapper class for containing whether a string is safe or - needs to be escaped. - - This allows lazy escaping of strings. Otherwise a string may be escaped - multiple times where it should only be escaped once. - - The **%SafeString** class itself provides information about whether a string - is safe from further escaping through the @ref isSafe method. The actual - string content held by the **%SafeString** instance is available through the - @ref get method. The @ref get method returns a QString subclass which should - be used like any other QString. The difference is that all methods on - NestedString return a **%SafeString** instead of a QString. - - @code - SafeString s("this & that", SafeString::IsSafe); - s.get().replace( "this", "these" ).toUpper(); - - qDebug() << s.get() << s.isSafe(); // outputs "these & that" false - @endcode - - Note that most operations on strings make the string unsafe. For example, - while "K & R" is safe, using replace("m", "n") will result in - "K &anp; R", which is unsafe. Likewise using upper() will return - "K & R", which is unsafe. Because the **%SafeString** can not - determine whether a method call with particular arguments will change - a **%SafeString** from being safe to being unsafe, any operation which can - possibly make the string unsafe does cause the string to become unsafe. It is - then up to the caller to restore safe-ness if needed. - - NestedString has overloads for SafeStrings whereever appropriate so that - strings remain marked as safe where possible. - - For example: - - @code - SafeString s1("this & that", SafeString::IsSafe); - s2 = s1; - s1.append( QString( " & the other" ) ); - // s1 is now "this & that & the other" and is unsafe. - - SafeString s3(" Wobl & Bob", SafeString::IsSafe); - s2.append(s3); - // Both s2 and s3 are safe, and append is a safe operation, so s2 - // is still safe - @endcode - - @see @ref autoescaping - @see OutputStream::escape - - The **%SafeString** class has appropriate operator overloads to make it - convenient to use in methods returning a QVariant, such as Filter::doFilter, - or as a QString. Note that a raw QString is essentially the same - as a **%SafeString** which is marked as unsafe. - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT SafeString -{ -public: - /** - Possible safety states of a **%SafeString** - */ - enum Safety { - IsSafe, ///< The string is safe and requires no further escaping - IsNotSafe ///< The string is not safe. It will be escaped before being - /// added to the output of rendering. - }; - - /** - Constructs an empty **%SafeString**. - */ - SafeString(); - - /** - Copy constructor - */ - SafeString(const SafeString &safeString); - - /** - Constructs a **%SafeString** with the content @p str whose safety is given - by @p safe. - */ - SafeString(const QString &str, bool safe); - - /** - Constructs a **%SafeString** with the content @p str whose safety is given - by @p safety. - */ - /* implicit */ SafeString(const QString &str, - Safety safety - = IsNotSafe); // krazy:exclude=explicit - - /** - Destructor - */ - ~SafeString(); - -#ifndef Q_QDOC - /** - Set whether the string should be escaped. - */ - void setNeedsEscape(bool needsEscape); -#endif - - /** - Whether the string needs to be escaped. - */ - bool needsEscape() const; - - /** - Whether the string is safe. - */ - bool isSafe() const; - -#ifndef Q_QDOC - /** - Set whether the string is safe. - */ - void setSafety(Safety safety); -#endif - - /** - @brief The NestedString is a QString whose methods always return a - SafeString - - This class is largely an implementation detail. See the SafeString - documentation for details. - */ - class GRANTLEE_TEMPLATES_EXPORT NestedString : public QString - { -#ifndef Q_QDOC - friend class SafeString; - SafeString *m_safeString; - - public: - NestedString(SafeString *safeString); - NestedString(const QString &content, SafeString *safeString); - - SafeString &append(const SafeString &str); - SafeString &append(const QString &str); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - SafeString &append(const QStringRef &ref); -#endif - SafeString &append(const QLatin1String &str); -#ifndef QT_NO_CAST_FROM_ASCII - SafeString &append(const QByteArray &ba) - { - QString::append(ba); - m_safeString->m_safety = IsNotSafe; - return *m_safeString; - } - - SafeString &append(const char *str) - { - QString::append(str); - m_safeString->m_safety = IsNotSafe; - return *m_safeString; - } -#endif - SafeString &append(const QChar ch); - - SafeString &fill(QChar ch, int size = -1); - - SafeString &insert(int position, const SafeString &str); - SafeString &insert(int position, const QString &str); - SafeString &insert(int position, const QLatin1String &str); - SafeString &insert(int position, const QChar *unicode, int size); - SafeString &insert(int position, QChar ch); - - SafeString left(int n) const; - SafeString leftJustified(int width, QChar fill = QLatin1Char(' '), - bool truncate = {}) const; - SafeString mid(int position, int n = -1) const; - - SafeString normalized(NormalizationForm mode) const; - SafeString normalized(NormalizationForm mode, - QChar::UnicodeVersion version) const; - - SafeString &prepend(const SafeString &str); - SafeString &prepend(const QString &str); - SafeString &prepend(const QLatin1String &str); -#ifndef QT_NO_CAST_FROM_ASCII - SafeString &prepend(const QByteArray &ba) - { - QString::prepend(ba); - m_safeString->m_safety = IsNotSafe; - return *m_safeString; - } - - SafeString &prepend(const char *str) - { - QString::prepend(str); - m_safeString->m_safety = IsNotSafe; - return *m_safeString; - } -#endif - SafeString &prepend(QChar ch); - - void push_back(const SafeString &other); - void push_front(const SafeString &other); - - SafeString &remove(int position, int n); - SafeString &remove(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &remove(const SafeString &str, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &remove(const QString &str, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &remove(const QRegularExpression &rx); - SafeString repeated(int times) const; - SafeString &replace(int position, int n, const SafeString &after); - SafeString &replace(int position, int n, const QString &after); - SafeString &replace(int position, int n, const QChar *unicode, int size); - SafeString &replace(int position, int n, QChar after); - SafeString &replace(const SafeString &before, const SafeString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QString &before, const SafeString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const SafeString &before, const QString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QString &before, const QString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QChar *before, int blen, const QChar *after, - int alen, Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(QChar ch, const SafeString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(QChar ch, const QString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(QChar before, QChar after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QLatin1String &before, const QLatin1String &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QLatin1String &before, const SafeString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QLatin1String &before, const QString &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const SafeString &before, const QLatin1String &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QString &before, const QLatin1String &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(QChar c, const QLatin1String &after, - Qt::CaseSensitivity cs = Qt::CaseSensitive); - SafeString &replace(const QRegularExpression &rx, const SafeString &after); - SafeString &replace(const QRegularExpression &rx, const QString &after); - - SafeString right(int n) const; - SafeString rightJustified(int width, QChar fill = QLatin1Char(' '), - bool truncate = {}) const; - - SafeString section(QChar sep, int start, int end = -1, - SectionFlags flags = SectionDefault) const; - SafeString section(const SafeString &sep, int start, int end = -1, - SectionFlags flags = SectionDefault) const; - SafeString section(const QString &sep, int start, int end = -1, - SectionFlags flags = SectionDefault) const; - SafeString section(const QRegularExpression ®, int start, int end = -1, - SectionFlags flags = SectionDefault) const; - SafeString &setNum(int n, int base = 10); - SafeString &setNum(uint n, int base = 10); - SafeString &setNum(long n, int base = 10); - SafeString &setNum(ulong n, int base = 10); - SafeString &setNum(qlonglong n, int base = 10); - SafeString &setNum(qulonglong n, int base = 10); - SafeString &setNum(short n, int base = 10); - SafeString &setNum(ushort n, int base = 10); - SafeString &setNum(double n, char format = 'g', int precision = 6); - SafeString &setNum(float n, char format = 'g', int precision = 6); - SafeString &setUnicode(const QChar *unicode, int size); - SafeString &setUtf16(const ushort *unicode, int size); - SafeString simplified() const; - - // QT_DEPRECATED_SINCE(5, 15) to support consumers building with - // -DQT_DISABLE_DEPRECATED_BEFORE=0x050f00 - // where QString enums will be invisible to the compiler -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_DEPRECATED_SINCE(5, 15) - // Calls with default argument for "behavior" should pick the Qt >= 5.14 - // version, if available -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - QStringList split(const SafeString &sep, QString::SplitBehavior behavior, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QString &sep, QString::SplitBehavior behavior, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QChar &sep, QString::SplitBehavior behavior, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QRegularExpression &rx, - QString::SplitBehavior behavior) const; -#else - QStringList split(const SafeString &sep, - QString::SplitBehavior behavior = QString::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QString &sep, - QString::SplitBehavior behavior = QString::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QChar &sep, - QString::SplitBehavior behavior = QString::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QRegularExpression &rx, - QString::SplitBehavior behavior - = QString::KeepEmptyParts) const; -#endif -#endif - -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - QStringList split(const SafeString &sep, - Qt::SplitBehavior behavior = Qt::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QString &sep, - Qt::SplitBehavior behavior = Qt::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QChar &sep, - Qt::SplitBehavior behavior = Qt::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringList split(const QRegularExpression &rx, - Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const; -#endif - - SafeString toLower() const; - SafeString toUpper() const; - SafeString trimmed() const; - - void chop(int n); -#endif - }; - - /** - Returns the String held by this **%SafeString** - */ - const NestedString &get() const { return m_nestedString; } - - /** - Returns the String held by this **%SafeString** - */ - NestedString &get() { return m_nestedString; } - - /** - Convenience operator for treating a **%SafeString** like a QString. - */ - operator QString() const { return m_nestedString; } - - /** - Assignment operator. - */ - SafeString &operator=(const SafeString &str); - - /** - Returns a concatenation of this with @p str. - - The result is not safe because str is not safe. - */ - SafeString operator+(const QString &str); - - /** - Returns a concatenation of this with @p str. - - The result is safe if both this and str are safe. - */ - SafeString operator+(const SafeString &str); - - /** - Appends the content of @p str to this. - - The result is not safe because @p str is not safe. - */ - SafeString &operator+=(const QString &str); - - /** - Appends the content of @p str to this. - - The result is safe if both this and @p str are safe. - */ - SafeString &operator+=(const SafeString &str); - - /** - Returns true if the content of @p other matches the content of this. - - Safeness and needing escaping are not accounted for in the comparison. - */ - bool operator==(const SafeString &other) const; - - /** - Returns true if the content of @p other matches the content of this. - - Safeness and needing escaping are not accounted for in the comparison. - */ - bool operator==(const QString &other) const; - - /** - Convenience operator for storing a **%SafeString** in a QVariant. - */ - operator QVariant() const { return QVariant::fromValue(*this); } - -private: -#ifndef Q_QDOC - NestedString m_nestedString; -#endif - Safety m_safety; - bool m_needsescape; -}; -} - -Q_DECLARE_METATYPE(Grantlee::SafeString) - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/taglibraryinterface.h b/qt6-after/qt6-migrated-legatus/include/grantlee/taglibraryinterface.h deleted file mode 100644 index a03e46a66..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/taglibraryinterface.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef TAGLIBRARYINTERFACE_H -#define TAGLIBRARYINTERFACE_H - -#include "outputstream.h" - -#include -#include - -namespace Grantlee -{ -class AbstractNodeFactory; -class Engine; -class Filter; - -/// @headerfile taglibraryinterface.h grantlee/taglibraryinterface.h - -/** - @brief The **%TagLibraryInterface** returns available tags and filters from - libraries. - - This interface must be implemented in tag and filter libraries. - - The implementation will usually be very simple. - - @code - class MyTagLibrary : public QObject, public TagLibraryInterface - { - Q_OBJECT - Q_INTERFACES( Grantlee::TagLibraryInterface ) - public: - MyTagLibrary( QObject *parent = {} ) - : QObject( parent ) { - } - - QHash - nodeFactories(const QString &name = {}) { - Q_UNUSED( name ); - QHash nodeFactories; - nodeFactories.insert( "mytag1", new MyTag1() ); - nodeFactories.insert( "mytag2", new MyTag2() ); - return nodeFactories; - } - - QHash filters( const QString &name = {} ) { - Q_UNUSED( name ); - - QHash filters; - - filters.insert( "myfilter1", new MyFilter1() ); - filters.insert( "myfilter2", new MyFilter2() ); - - return filters; - } - }; - @endcode - - @author Stephen Kelly -*/ -class TagLibraryInterface -{ -public: - virtual ~TagLibraryInterface() {} - - /** - Returns the AbstractNodeFactory implementations available in this library. - */ - virtual QHash - nodeFactories(const QString &name = {}) - { - Q_UNUSED(name); - static const QHash h; - return h; - }; - - /** - Returns the Filter implementations available in this library. - */ - virtual QHash filters(const QString &name = {}) - { - Q_UNUSED(name); - static const QHash h; - return h; - }; -}; -} - -Q_DECLARE_INTERFACE(Grantlee::TagLibraryInterface, - "org.grantlee.TagLibraryInterface/1.0") - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/template.h b/qt6-after/qt6-migrated-legatus/include/grantlee/template.h deleted file mode 100644 index 937c906f5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/template.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_TEMPLATE_H -#define GRANTLEE_TEMPLATE_H - -#include "exception.h" -#include "grantlee_templates_export.h" -#include "node.h" - -#include -#include - -namespace Grantlee -{ -class Context; -class Engine; -class TemplateImpl; -class OutputStream; - -#ifdef Q_QDOC -#define TemplateImpl Template -#else -typedef QSharedPointer Template; -#endif - -class TemplatePrivate; - -/// @headerfile template.h grantlee/template.h - -/** - @brief The **%Template** class is a tree of nodes which may be rendered. - - All Templates are created through the Grantlee::Engine class. - A **%Template** is created by parsing some text markup passed into the Engine, - or by reading it from a file. - - Note that **%Template** is actually a typedef for a - QSharedPointer<TemplateImpl>, so all of its members should be - accessed with operator->(). - - The result of parsing is a **%Template** object which can be rendered multiple - times with multiple different Contexts. - - @code - auto engine = getEngine(); - auto t = engine->newTemplate( - "{{ name }} is aged {{ age }}", - "simple template" ); - if ( t->error() ) - { - // Tokenizing or parsing error, or couldn't find custom tags or filters. - qDebug() << t->errorString(); - return; - } - QTextStream textStream( stdout ); - OutputStream stream( textStream ); - - for ( ... ) - { - Context c; - // ... c.insert - t->render( stream, c ); - - if (t->error()) - { - // Rendering error. - qDebug() << t->errorString(); - } - } - @endcode - - If there is an error in parsing or rendering, the @ref error and @ref - errorString methods can be used to check the source of the error. - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT TemplateImpl : public QObject -{ - Q_OBJECT -public: - ~TemplateImpl() override; - - /** - Renders the **%Template** to a string given the Context @p c. - */ - QString render(Context *c) const; - - /** - Renders the **%Template** to the OutputStream @p stream given the Context c. - */ - OutputStream *render(OutputStream *stream, Context *c) const; - -#ifndef Q_QDOC - /** - @internal - */ - NodeList nodeList() const; - - /** - @internal - */ - void setNodeList(const NodeList &list); -#endif - - /** - Returns an error code for the error encountered. - */ - Error error() const; - - /** - Returns more information to developers in the form of a string. - */ - QString errorString() const; - - /** - Returns the Engine that created this **%Template**. - */ - Engine const *engine() const; - -#ifndef Q_QDOC -protected: - TemplateImpl(Engine const *engine, QObject *parent = {}); - TemplateImpl(Engine const *engine, bool smartTrim, QObject *parent = {}); - - void setContent(const QString &templateString); -#endif - -private: - // Don't allow setting the parent on a Template, which is memory managed as - // a QSharedPointer. - using QObject::setParent; - -private: - Q_DECLARE_PRIVATE(Template) - TemplatePrivate *const d_ptr; -#ifndef Q_QDOC - friend class Engine; - friend class Parser; -#endif -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/templateloader.h b/qt6-after/qt6-migrated-legatus/include/grantlee/templateloader.h deleted file mode 100644 index 5b09c9bf5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/templateloader.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_TEMPLATELOADER_H -#define GRANTLEE_TEMPLATELOADER_H - -#include "grantlee_templates_export.h" -#include "template.h" - -#include - -namespace Grantlee -{ - -class AbstractLocalizer; - -/// @headerfile templateloader.h grantlee/templateloader.h - -/** - @brief An retrieval interface to a storage location for Template objects. - - This interface can be implemented to define new ways of retrieving the content - of Templates. - - The interface of this class should not be called directly from applications. - TemplateLoaders will typically be created, configured and added to the - Grantlee::Engine which will call the appropriate API. - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT AbstractTemplateLoader -{ -public: - /** - Destructor - */ - virtual ~AbstractTemplateLoader(); - - /** - Load a Template called @p name. Return an invalid Template if no content - by that name exists. - */ - virtual Template loadByName(const QString &name, - Engine const *engine) const = 0; - - /** - Return a complete URI for media identified by fileName. - */ - virtual QPair - getMediaUri(const QString &fileName) const = 0; - - /** - Return true if a Template identified by @p name exists and can be loaded. - */ - virtual bool canLoadTemplate(const QString &name) const = 0; -}; - -/// @headerfile templateloader.h grantlee/templateloader.h - -class FileSystemTemplateLoaderPrivate; - -/** - @brief The **%FileSystemTemplateLoader** loads Templates from the file system. - - This template loader works by traversing a list of directories to find - templates. Directories are checked in order, and the first match hit is parsed - and returned. - - @code - loader->setTemplateDirs({ - "/home/user/app/templates", - "/usr/local/share/app/templates" - }); - engine->setTemplateLoader( loader ); - - // This will try /home/user/app/templates/mytemplate.html - // followed by /usr/local/share/app/templates/mytemplate.html - engine->loadByName( "mytemplate.html" ); - @endcode - - Additionally, a themeName may be set on the template loader, which will be - appended to search paths before the template name. - - @code - loader->setTemplateDirs({ - "/home/user/app/templates" << - "/usr/local/share/app/templates" - }); - loader->setTheme( "simple_theme" ); - engine->setTemplateLoader( loader ); - - // This will try /home/user/app/templates/simple_theme/mytemplate.html - // followed by /usr/local/share/app/templates/simple_theme/mytemplate.html - engine->loadByName( "mytemplate.html" ); - @endcode - - Media URIs may be retrieved for media relative to the directories searched - queried for templates. - - @code - loader->setTemplateDirs({ - "/home/user/app/templates", - "/usr/local/share/app/templates" - }); - loader->setTheme( "simple_theme" ); - engine->setTemplateLoader( loader ); - - // This will try /home/user/app/templates/simple_theme/logo.png - // followed by /usr/local/share/app/templates/simple_theme/logo.png - // and return the first one that exists. - engine->mediaUri( "logo.png" ); - @endcode - - The template files loaded by a %**FileSystemTemplateLoader** must be UTF-8 - encoded. - - @see @ref deploying_templates - -*/ -class GRANTLEE_TEMPLATES_EXPORT FileSystemTemplateLoader - : public AbstractTemplateLoader -{ -public: - /** - Constructor - */ - FileSystemTemplateLoader(const QSharedPointer localizer - = {}); - - /** - Destructor - */ - ~FileSystemTemplateLoader() override; - - Template loadByName(const QString &name, Engine const *engine) const override; - - bool canLoadTemplate(const QString &name) const override; - - QPair getMediaUri(const QString &fileName) const override; - - /** - Sets the theme of this loader to @p themeName - */ - void setTheme(const QString &themeName); - - /** - The themeName of this TemplateLoader - */ - QString themeName() const; - - /** - Sets the directories to look for template files to @p dirs. - */ - void setTemplateDirs(const QStringList &dirs); - - /** - The directories this TemplateLoader looks in for template files. - */ - QStringList templateDirs() const; - -private: - Q_DECLARE_PRIVATE(FileSystemTemplateLoader) - FileSystemTemplateLoaderPrivate *const d_ptr; -}; - -/// @headerfile templateloader.h grantlee/templateloader.h - -/** - @brief The **%InMemoryTemplateLoader** loads Templates set dynamically in - memory - - This class is mostly used for testing purposes, but can also be used for - simple uses of %Grantlee. - - Templates can be made available using the @ref setTemplate method, and will - then be retrieved by the Grantlee::Engine as appropriate. -*/ -class GRANTLEE_TEMPLATES_EXPORT InMemoryTemplateLoader - : public AbstractTemplateLoader -{ -public: - InMemoryTemplateLoader(); - ~InMemoryTemplateLoader() override; - - Template loadByName(const QString &name, Engine const *engine) const override; - - bool canLoadTemplate(const QString &name) const override; - - QPair getMediaUri(const QString &fileName) const override; - - /** - Add a template content to this Loader. - - Example: - - @code - auto loader = QSharedPointersetTemplate( "name_template", "My name is {{ name }}" ); - loader->setTemplate( "age_template", "My age is {{ age }}" ); - engine->addTemplateLoader( loader ); - - // Both templates may now be retrieved by calling Engine::loadByName. - @endcode - */ - void setTemplate(const QString &name, const QString &content); - -private: - QHash m_namedTemplates; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/texthtmlbuilder.h b/qt6-after/qt6-migrated-legatus/include/grantlee/texthtmlbuilder.h deleted file mode 100644 index 22dec91f5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/texthtmlbuilder.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2008 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_TEXTHTMLBUILDER_H -#define GRANTLEE_TEXTHTMLBUILDER_H - -#ifdef Q_CC_MSVC -#pragma warning(disable : 4250) -#endif - -#include "abstractmarkupbuilder.h" -#include "grantlee_textdocument_export.h" -#include "markupdirector.h" - -namespace Grantlee -{ - -class TextHTMLBuilderPrivate; - -/// @headerfile texthtmlbuilder.h grantlee/texthtmlbuilder.h - -/** - @brief The TextHTMLBuilder creates a clean html markup output. - - This class creates html output which is as minimal as possible and restricted - to the rich text features supported in %Qt. - (https://doc.qt.io/qt-5/richtext-html-subset.html) - - The output contains only the body content, not the head element or other - metadata. - - eg: - - @code -

- This is some formatted content in a paragraph. -

- @endcode - - instead of the content produced by %Qt: - - @code - - -

This is some formatted content in a paragraph. -

- @endcode - - Such tags should be created separately. For example: - - @code - auto b = new TextHTMLBuilder(); - auto md = new MarkupDirector(b); - md->constructContent(); - QString cleanHtml( - "\n%1\n\n%2\n") - .arg(document.metaInformation(QTextDocument::DocumentTitle)) - .arg(b->getOutput()); - file.write(cleanHtml); - @endcode - - Font formatting information on elements is represented by individual span - elements. - - eg: - @code - - - Blue text on red background - - - @endcode - - instead of - - @code - - Blue text on red background - - @endcode - - It my be possible to change this if necessary. - - @author Stephen Kelly -*/ -class GRANTLEE_TEXTDOCUMENT_EXPORT TextHTMLBuilder - : virtual public AbstractMarkupBuilder -{ -public: - TextHTMLBuilder(); - ~TextHTMLBuilder() override; - - void beginStrong() override; - void endStrong() override; - void beginEmph() override; - void endEmph() override; - void beginUnderline() override; - void endUnderline() override; - void beginStrikeout() override; - void endStrikeout() override; - void beginForeground(const QBrush &brush) override; - void endForeground() override; - void beginBackground(const QBrush &brush) override; - void endBackground() override; - void beginAnchor(const QString &href = {}, const QString &name = {}) override; - void endAnchor() override; - - // Maybe this stuff should just be added to a list, and then when I add - // literal text, - // add some kind of style attribute in one span instead of many. - void beginFontFamily(const QString &family) override; - void endFontFamily() override; - - /** - Begin a new font point size - @param size The new size to begin. - */ - void beginFontPointSize(int size) override; - void endFontPointSize() override; - - /** - Begin a new paragraph - @param al The new paragraph alignment - @param topMargin The new paragraph topMargin - @param bottomMargin The new paragraph bottomMargin - @param leftMargin The new paragraph leftMargin - @param rightMargin The new paragraph rightMargin - */ - void beginParagraph(Qt::Alignment al = Qt::AlignLeft, qreal topMargin = 0.0, - qreal bottomMargin = 0.0, qreal leftMargin = 0.0, - qreal rightMargin = 0.0) override; - - /** - Begin a new header element. - @param level The new level to begin. - */ - void beginHeader(int level) override; - - /** - End a header element. - @param level The new level to end. - */ - void endHeader(int level) override; - - void endParagraph() override; - void addNewline() override; - - void insertHorizontalRule(int width = -1) override; - - void insertImage(const QString &src, qreal width, qreal height) override; - - void beginList(QTextListFormat::Style type) override; - - void endList() override; - - void beginListItem() override; - void endListItem() override; - - void beginSuperscript() override; - - void endSuperscript() override; - - void beginSubscript() override; - - void endSubscript() override; - - void beginTable(qreal cellpadding, qreal cellspacing, - const QString &width) override; - - void beginTableRow() override; - void beginTableHeaderCell(const QString &width, int colspan, - int rowspan) override; - - void beginTableCell(const QString &width, int colspan, int rowspan) override; - - void endTable() override; - void endTableRow() override; - void endTableHeaderCell() override; - void endTableCell() override; - - /** - Reimplemented from AbstractMarkupBuilder. - - This implementation escapes the text before appending so that - - @verbatim - A sample bold word. - @endverbatim - - becomes - - @verbatim - A sample <b>bold</b> word. - @endverbatim - */ - void appendLiteralText(const QString &text) override; - - /** - Append @p text without escaping. - - This is useful if extending MarkupDirector - */ - void appendRawText(const QString &text) override; - - QString getResult() override; - -private: - TextHTMLBuilderPrivate *d_ptr; - Q_DECLARE_PRIVATE(TextHTMLBuilder) -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/token.h b/qt6-after/qt6-migrated-legatus/include/grantlee/token.h deleted file mode 100644 index 685a1e9c6..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/token.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_TOKEN_H -#define GRANTLEE_TOKEN_H - -#include - -namespace Grantlee -{ - -/** - @internal - - The available token types. -*/ -enum TokenType { - TextToken, ///< The Token is a text fragment - VariableToken, ///< The Token is a variable node - BlockToken, ///< The Token is a block, ie, part of a tag - CommentToken ///< The Token is a comment node. -}; - -/// @headerfile token.h grantlee/token.h - -/** - A token in a parse stream for a template. - - This class is only relevant for template tag implementations. -*/ -struct Token { - int tokenType; ///< The Type of this Token - int linenumber; ///< The line number this Token starts at - QString content; ///< The content of this Token -}; -} - -Q_DECLARE_TYPEINFO(Grantlee::Token, Q_MOVABLE_TYPE); - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/typeaccessor.h b/qt6-after/qt6-migrated-legatus/include/grantlee/typeaccessor.h deleted file mode 100644 index 067d7f0bd..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/typeaccessor.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_TYPEACCESSOR_H -#define GRANTLEE_TYPEACCESSOR_H - -#include "grantlee_templates_export.h" - -#include - -/// @file - -namespace Grantlee -{ - -#ifndef Q_QDOC -template struct TypeAccessor { - static QVariant lookUp(const T object, const QString &property); -}; - -template struct TypeAccessor { - static QVariant lookUp(const T *const object, const QString &property); -}; - -template struct TypeAccessor { - static QVariant lookUp(const T &object, const QString &property); -}; -#endif -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/util.h b/qt6-after/qt6-migrated-legatus/include/grantlee/util.h deleted file mode 100644 index 18110e266..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/util.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_UTIL_P_H -#define GRANTLEE_UTIL_P_H - -#include "context.h" -#include "grantlee_templates_export.h" -#include "safestring.h" - -#include - -/// @file util.h Utility functions used throughout %Grantlee. - -namespace Grantlee -{ - -/** - Returns whether the @p variant is evaluated to true. - - @see @ref truthiness -*/ -GRANTLEE_TEMPLATES_EXPORT bool variantIsTrue(const QVariant &variant); - -/** - Converts the @p input into its unescaped form. - - Double slashes are converted to single slashes, \\" is converted to " - etc. -*/ -GRANTLEE_TEMPLATES_EXPORT QString unescapeStringLiteral(const QString &input); - -/** - Marks the @p input as safe. -*/ -GRANTLEE_TEMPLATES_EXPORT Grantlee::SafeString -markSafe(const Grantlee::SafeString &input); - -/** - Marks the @p input as requiring escaping. -*/ -GRANTLEE_TEMPLATES_EXPORT Grantlee::SafeString -markForEscaping(const Grantlee::SafeString &input); - -/** - Retrieves and returns a SafeString from the @p input. -*/ -GRANTLEE_TEMPLATES_EXPORT Grantlee::SafeString -getSafeString(const QVariant &input); - -/** - Returns whether @p input contains a SafeString. -*/ -GRANTLEE_TEMPLATES_EXPORT bool isSafeString(const QVariant &input); - -/** - Returns true if the type of @p input can be inserted into a rendered template - directly. - - Note that lists, hashes and QObject*s can not be. -*/ -GRANTLEE_TEMPLATES_EXPORT bool supportedOutputType(const QVariant &input); - -/** - Compares @p lhs and @p rhs for equality. SafeStrings are compared as raw - QStrings. Their safeness is not part of the comparison. - - @see QVariant::operator== -*/ -GRANTLEE_TEMPLATES_EXPORT bool equals(const QVariant &lhs, const QVariant &rhs); - -/** - Converts @p size into the nearest file size unit like MB or MiB, based on the - @p unitSystem value. Use @c 2 for the @p unitSystem to get binary units, use - @c 10 to get decimal units - by default, decimal units will be returned. The - @p multiplier can be used if the input @p size is not in pure bytes. If @p - size is for example given in @a KiB, use a multiplier of @a 1024. The returned - pair will have the converted size as @a first and the unit as @a second. -*/ -GRANTLEE_TEMPLATES_EXPORT std::pair -calcFileSize(qreal size, int unitSystem = 10, qreal multiplier = 1.0); - -#ifndef Q_QDOC -/** - @internal - Returns the @p list as a formatted string. This is for debugging purposes - only. -*/ -GRANTLEE_TEMPLATES_EXPORT Grantlee::SafeString -toString(const QVariantList &list); -#endif -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/grantlee/variable.h b/qt6-after/qt6-migrated-legatus/include/grantlee/variable.h deleted file mode 100644 index edeb6403f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/grantlee/variable.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - This file is part of the Grantlee template system. - - Copyright (c) 2009,2010 Stephen Kelly - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either version - 2.1 of the Licence, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef GRANTLEE_VARIABLE_H -#define GRANTLEE_VARIABLE_H - -#include "grantlee_templates_export.h" - -#include - -namespace Grantlee -{ -class Context; - -class VariablePrivate; - -/// @headerfile variable.h grantlee/variable.h - -/** - @brief A container for static variables defined in Templates. - - This class is only relevant to Template tag authors. - - When processing a template tag in a AbstractNodeFactory implementation, it - will sometimes make sense to process arguments to the tag as - Grantlee::Variables. Note that usually they should be processed as - FilterExpression objects instead. - - Arguments to the tag can be used to construct Variables, which may then be - resolved into the objects they represent in the given Context in the render - stage. - - @author Stephen Kelly -*/ -class GRANTLEE_TEMPLATES_EXPORT Variable -{ -public: - /** - Constructs an invalid **%Variable** - */ - Variable(); - - /** - Creates a **%Variable** represented by the given @p var - */ - explicit Variable(const QString &var); - - /** - Copy constructor - */ - Variable(const Variable &other); - - /** - Destructor - */ - ~Variable(); - - /** - Assignment operator. - */ - Variable &operator=(const Variable &other); - - /** - Returns whether this **%Variable** is valid. - */ - bool isValid() const; - - /** - Returns whether this **%Variable** evaluates to true with the Context @p c. - */ - bool isTrue(Context *c) const; - - /** - Resolves this **%Variable** with the Context @p c. - */ - QVariant resolve(Context *c) const; - - /** - Returns whether this **%Variable** is a constant in the Template. A constant - is represented as a static string in the template - - @code - Text content - {% some_tag "constant" variable %} - @endcode - */ - bool isConstant() const; - - /** - Returns whether this variable is localized, that is, if it is wrapped with - _(). @see @ref i18n_l10n - */ - bool isLocalized() const; - - /** - Returns whether this variable is a literal string or number. A - literal **%Variable** does not have any lookup components. - */ - QVariant literal() const; - - /** - Returns the lookup components of this **%Variable**. - */ - QStringList lookups() const; - -private: - Q_DECLARE_PRIVATE(Variable) - VariablePrivate *const d_ptr; -}; -} - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/include/nglapplication/CMakeLists.txt deleted file mode 100755 index ab68c2ac6..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/CMakeLists.txt +++ /dev/null @@ -1,138 +0,0 @@ -# -# $Id$ -# $HeadURL$ -# $Author$ -# - -# -# nglapplication -# -SET(nglapplication_SRCS - nglapplication.cpp - nglapplication.h - nglloggerhandler.cpp - nglloggerhandler.h - ngl_qt_msg_handler.inc - ngl_signal_handler.inc -) -NGL_ADD_LIBRARY2(WS AAR SV HLA nglapplication SHARED ${nglapplication_SRCS}) -NGL_TARGET_INCLUDE_DIRECTORIES(nglapplication - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/../ -) -if(QT6_GUI_AVAILABLE) - NGL_TARGET_LINK_LIBRARIES(nglapplication - PRIVATE - NGLLogger - nglsettings - PUBLIC - Qt6::Core - Qt6::Widgets - ) -endif() -NGL_INSTALL_TARGET(nglapplication) - -# -# nglsingleapplication -# -SET(nglsingleapplication_SRCS - nglsingleapplication.cpp - nglsingleapplication.h - nglloggerhandler.cpp - nglloggerhandler.h - ngl_qt_msg_handler.inc - ngl_signal_handler.inc -) -NGL_ADD_LIBRARY2(WS nglsingleapplication SHARED ${nglsingleapplication_SRCS}) -NGL_TARGET_INCLUDE_DIRECTORIES(nglsingleapplication - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/../ -) -NGL_TARGET_LINK_LIBRARIES(nglsingleapplication - PRIVATE - NGLLogger - nglsettings - PUBLIC - qtsingleapplication -) -NGL_INSTALL_TARGET(nglsingleapplication) - -# -# nglcoreapplication -# -SET(nglcoreapplication_SRCS - nglcoreapplication.cpp - nglcoreapplication.h - nglloggerhandler.cpp - nglloggerhandler.h - ngl_qt_msg_handler.inc - ngl_signal_handler.inc -) - -NGL_ADD_LIBRARY2(ALL nglcoreapplication SHARED ${nglcoreapplication_SRCS}) -NGL_TARGET_INCLUDE_DIRECTORIES(nglcoreapplication - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/../ -) -NGL_TARGET_LINK_LIBRARIES(nglcoreapplication - PRIVATE - NGLLogger - nglsettings - PUBLIC - Qt6::Core -) -NGL_INSTALL_TARGET(nglcoreapplication) - -# -# nglsinglecoreapplication -# -SET(nglsinglecoreapplication_SRCS - nglsinglecoreapplication.cpp - nglsinglecoreapplication.h - nglloggerhandler.cpp - nglloggerhandler.h - ngl_qt_msg_handler.inc - ngl_signal_handler.inc -) - -NGL_ADD_LIBRARY2(AAR SV nglsinglecoreapplication SHARED ${nglsinglecoreapplication_SRCS}) -NGL_TARGET_INCLUDE_DIRECTORIES(nglsinglecoreapplication - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/../ -) -NGL_TARGET_LINK_LIBRARIES(nglsinglecoreapplication - PRIVATE - NGLLogger - nglsettings - PUBLIC - qtsinglecoreapplication -) -NGL_INSTALL_TARGET(nglsinglecoreapplication) - -# -# nglguiapplication -# -SET(nglguiapplication_SRCS - nglguiapplication.cpp - nglguiapplication.h - nglloggerhandler.cpp - nglloggerhandler.h - ngl_qt_msg_handler.inc - ngl_signal_handler.inc -) - -NGL_ADD_LIBRARY2(ALL nglguiapplication SHARED ${nglguiapplication_SRCS}) -NGL_TARGET_INCLUDE_DIRECTORIES(nglguiapplication - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/../ -) -if(QT6_GUI_AVAILABLE) - NGL_TARGET_LINK_LIBRARIES(nglguiapplication - PRIVATE - NGLLogger - nglsettings - PUBLIC - Qt6::Gui - ) -endif() -NGL_INSTALL_TARGET(nglguiapplication) diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_qt_msg_handler.inc b/qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_qt_msg_handler.inc deleted file mode 100755 index 2170643d5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_qt_msg_handler.inc +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @RDE_HEADER@ - * callback to catch qt log messages - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include -#include - -static void qtMsgHandler(QtMsgType type, const QMessageLogContext &, const QString &msg) -{ - // pulse audio connect errors are important but can be very annoying - so only print it ONE time only and also as an error - static bool pulseAudioMessageSent = false; - static QString pulseAudioMessage = QStringLiteral("PulseAudioService: pa_context_connect() failed"); - if (msg.startsWith(pulseAudioMessage)) - { - if (pulseAudioMessageSent) - { - return; - } - - type = QtCriticalMsg; - pulseAudioMessageSent = true; - } - - - try - { - NGL::INGLLogger &l = NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger( "NGL.Qt" ); - switch (type) { - case QtDebugMsg: - DEBUG_LOG(l) << msg ; - break; - case QtInfoMsg: - INFO_LOG(l) << msg ; - break; - case QtWarningMsg: - WARNING_LOG(l) << msg ; - break; - case QtCriticalMsg: - ERROR_LOG(l) << msg ; - break; - case QtFatalMsg: - FATAL_LOG(l) << msg ; - break; - } - } catch (...) { - switch (type) - { - case QtDebugMsg: - case QtInfoMsg: - fputs(qPrintable(msg), stdout); - break; - case QtWarningMsg: - case QtCriticalMsg: - case QtFatalMsg: - fputs(qPrintable(msg), stderr); - break; - } - } -} - diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_signal_handler.inc b/qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_signal_handler.inc deleted file mode 100755 index 78d6ee031..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/ngl_signal_handler.inc +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @RDE_HEADER@ - * small stub to catch SIGTERM for proper shutdown - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include -#include - -#ifdef Q_OS_WIN -#include -#include - - -class MyEventFilter final : public QAbstractNativeEventFilter -{ - public: - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override - { - Q_UNUSED(eventType); - Q_UNUSED(result); - const MSG *msg = reinterpret_cast(message); - if (msg->message == WM_CLOSE && msg->hwnd == nullptr) - QCoreApplication::quit(); - return false; - } -}; -#endif - -#ifndef SIGTERM -# define SIGTERM 15 -#endif -static void signalHandler(int signal_number) -{ - if(signal_number != SIGTERM) - return; - QCoreApplication::quit(); -} - diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.cpp b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.cpp deleted file mode 100755 index 924f3e6ce..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QApplication for window handling - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include "nglapplication.h" -#include "ngl_signal_handler.inc" - -//---------------------------------------------------------------------------- -NGLApplication::NGLApplication(int &argc, char **argv) - : QApplication(argc, argv) -{ - // auf SIGTERM reagieren - signal(SIGTERM, &signalHandler); -#ifdef Q_OS_WIN - installNativeEventFilter(new MyEventFilter); -#endif -} - -//---------------------------------------------------------------------------- -bool NGLApplication::notify(QObject *o, QEvent *e) -{ - bool bRet = false; - try - { - bRet = QApplication::notify(o, e); - } - catch (const std::exception &e) - { - fprintf(stderr, "exception %s\n", e.what()); - } - return bRet; -} diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.h b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.h deleted file mode 100755 index acc2c6aa0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglapplication.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QApplication for window handling - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include -#include "nglloggerhandler.h" - -#ifndef NGLAPPLICATION_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define NGLAPPLICATION_EXPORT -# else -# ifdef MAKE_NGLAPPLICATION_LIB -# define NGLAPPLICATION_EXPORT Q_DECL_EXPORT -# else -# define NGLAPPLICATION_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif - -namespace NGL -{ -class INGLLogger; -} - -class NGLAPPLICATION_EXPORT NGLApplication : public QApplication, public NGL::LoggerHandler -{ - Q_OBJECT - -public: - NGLApplication(int &argc, char **argv); - -protected: - bool notify(QObject *o, QEvent *e) override; -}; - -#define nglApp static_cast(NGLApplication::instance()) diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.cpp b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.cpp deleted file mode 100755 index 8583cab6d..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QCoreApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include "nglcoreapplication.h" - -#include "ngl_signal_handler.inc" - -//---------------------------------------------------------------------------- -NGLCoreApplication::NGLCoreApplication(int &argc, char **argv) - : QCoreApplication(argc, argv) -{ - // auf SIGTERM reagieren - signal(SIGTERM, &signalHandler); -#ifdef Q_OS_WIN - installNativeEventFilter(new MyEventFilter); -#endif -} diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.h b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.h deleted file mode 100755 index 0174416a0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglcoreapplication.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QCoreApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include -#include "nglloggerhandler.h" - -#ifndef NGLCOREAPPLICATION_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define NGLCOREAPPLICATION_EXPORT -# else -# ifdef MAKE_NGLCOREAPPLICATION_LIB -# define NGLCOREAPPLICATION_EXPORT Q_DECL_EXPORT -# else -# define NGLCOREAPPLICATION_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif - -namespace NGL -{ -class INGLLogger; -} - -class NGLCOREAPPLICATION_EXPORT NGLCoreApplication : public QCoreApplication, public NGL::LoggerHandler -{ - Q_OBJECT - -public: - NGLCoreApplication(int &argc, char **argv); -}; diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.cpp b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.cpp deleted file mode 100755 index bf89485ea..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QCoreApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include "nglguiapplication.h" - -#include "ngl_signal_handler.inc" - -//---------------------------------------------------------------------------- -NGLGuiApplication::NGLGuiApplication(int &argc, char **argv) - : QGuiApplication(argc, argv) -{ - // auf SIGTERM reagieren - signal(SIGTERM, &signalHandler); -#ifdef Q_OS_WIN - installNativeEventFilter(new MyEventFilter); -#endif -} diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.h b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.h deleted file mode 100755 index 512e3e5e6..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglguiapplication.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QCoreApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include -#include "nglloggerhandler.h" - -#ifndef NGLGUIAPPLICATION_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define NGLGUIAPPLICATION_EXPORT -# else -# ifdef MAKE_NGLGUIAPPLICATION_LIB -# define NGLGUIAPPLICATION_EXPORT Q_DECL_EXPORT -# else -# define NGLGUIAPPLICATION_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif - -namespace NGL -{ -class INGLLogger; -} - -class NGLGUIAPPLICATION_EXPORT NGLGuiApplication : public QGuiApplication, public NGL::LoggerHandler -{ - Q_OBJECT - -public: - NGLGuiApplication(int &argc, char **argv); -}; - -#define nglGuiApp static_cast(NGLGuiApplication::instance()) diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.cpp b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.cpp deleted file mode 100755 index 92a56746e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @RDE_HEADER@ - * Logger handling stuff for NGL(Core|Gui)Application - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include "nglloggerhandler.h" -#include "ngl_qt_msg_handler.inc" - -#include -#include -#include - -namespace NGL -{ - -static QByteArray username() -{ -#ifdef Q_OS_WIN - return qgetenv("USERNAME"); -#else - return qgetenv("USER"); -#endif -} - -static void setEnvVars() -{ - // set LOGPATH to the globally configured path - const QString logPath = NGL::Settings::logPath(); - qputenv("LOG4QT_LOGDIR", logPath.toLocal8Bit()); - qputenv("LOG4QT_USER", username()); -} - -//---------------------------------------------------------------------------- -void LoggerHandler::createLogger(const QByteArray &baseName, const char *configFileName, bool quiet) -{ - setEnvVars(); - m_baseLoggerName = baseName; - - const QString bnStr(QString::fromLatin1(baseName.toLower())); - const QString logPath = NGL::Settings::logPath(); - m_loggerFilenamePostfix = logPath + QLatin1Char('/') + QString::fromLocal8Bit(username()) + QLatin1Char('_') + bnStr; - m_loggerFilenamePrefix = QLatin1String(".log"); - - const QString logOutputName = m_loggerFilenamePostfix + m_loggerFilenamePrefix; - NGL::NGLLoggerBootstrap::createNGLRootLogger(QString::fromLatin1(configFileName), false, logOutputName, quiet); - - // Qt-Messages abfangen - qInstallMessageHandler(&qtMsgHandler); -} - -//---------------------------------------------------------------------------- -void LoggerHandler::createLogger(const QByteArray &baseName, int exerciseId, int additionalId, bool quiet) -{ - setEnvVars(); - - const QString bnStr(QString::fromLatin1(baseName.toLower())); - const QString configFileName = QLatin1String("log4cxx_") + bnStr + QLatin1String(".props"); - const QString logPath = NGL::Settings::logPath(); - m_loggerFilenamePostfix = logPath + QLatin1Char('/') + QString::fromLocal8Bit(username()) + QLatin1Char('_') + bnStr; - if (exerciseId > 0) - m_loggerFilenamePostfix += QLatin1Char('_') + QString::number(exerciseId); - if (additionalId > 0) - m_loggerFilenamePostfix += QLatin1Char('_') + QString::number(additionalId); - - m_loggerFilenamePrefix = QLatin1String(".log"); - m_baseLoggerName = baseName + QByteArray(".main"); - - const QString logOutputName = m_loggerFilenamePostfix + m_loggerFilenamePrefix; - NGL::NGLLoggerBootstrap::createNGLRootLogger(configFileName, false, logOutputName, quiet); - - // Qt-Messages abfangen - qInstallMessageHandler(&qtMsgHandler); -} - -//---------------------------------------------------------------------------- -NGL::INGLLogger &LoggerHandler::baseLogger() const -{ - return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(m_baseLoggerName.data()); -} - -//---------------------------------------------------------------------------- -NGL::INGLLogger &LoggerHandler::logger(const char *loggerName) const -{ - return NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger(loggerName); -} - -//---------------------------------------------------------------------------- -LoggerHandler *LoggerHandler::getLoggerHandler() -{ - return dynamic_cast(QCoreApplication::instance()); -} - -} // namespace NGL diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.h b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.h deleted file mode 100755 index 69b854060..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglloggerhandler.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @RDE_HEADER@ - * Logger handling stuff for NGL(Core|Gui)Application - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include -#include - -#ifndef LOGGERHANDLER_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define LOGGERHANDLER_EXPORT -# else -# if defined(MAKE_NGLCOREAPPLICATION_LIB) || defined(MAKE_NGLGUIAPPLICATION_LIB) || defined(MAKE_NGLAPPLICATION_LIB) || defined(MAKE_NGLSINGLECOREAPPLICATION_LIB) || defined(MAKE_NGLSINGLEAPPLICATION_LIB) -# define LOGGERHANDLER_EXPORT Q_DECL_EXPORT -# else -# define LOGGERHANDLER_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif - -namespace NGL -{ -class INGLLogger; - -class LOGGERHANDLER_EXPORT LoggerHandler -{ -public: - LoggerHandler() = default; - ~LoggerHandler() = default; - - /** - * @brief Creates a NGL RootLogger instance, using baseName as the name for the base logger and configFileName for the .props file - * @param baseName the name of the service/application - * @param configFileName The file name with the logging informations - * @param checkTime the time (in seconds) to check for modifications of the file - */ - void createLogger(const QByteArray &baseName, - const char *configFileName, - bool quiet = false); - - /** - * @brief Creates a NGL RootLogger instance, using .main as the base logger name, - * configFileName is created with 'log4cxx_.props' - * @param baseName the name of the service/application - * @param exerciseId the (optional) exercise id, if > 0, - * @param additionalId an (optional) id to be used for logfile name creation, - * the output log name is created with ${USER}__.log - */ - void createLogger(const QByteArray &baseName, - int exerciseId = 0, - int additionalId = 0, - bool quiet = false); - - /** - * @brief get the base Logger created with createLogger() - */ - NGL::INGLLogger &baseLogger() const; - - /** - * @brief Get a logger with the given name - * @param The logger to retrieve - */ - NGL::INGLLogger &logger(const char *loggerName) const; - - /** - * @brief get the log filename postfix (e.g. /shd/CTC/log/ctc_foo) - */ - QString loggerNamePostfix() const { return m_loggerFilenamePostfix; } - - /** - * @brief get the log filename prefix (e.g. .log) - */ - QString loggerNamePrefix() const { return m_loggerFilenamePrefix; } - - /** - * @brief Retrieves the loggerhandler from ngl(core)application or nullptr - */ - static LoggerHandler *getLoggerHandler(); -private: - QByteArray m_baseLoggerName; - QString m_loggerFilenamePostfix; - QString m_loggerFilenamePrefix; -}; -} // namespace NGL diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.cpp b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.cpp deleted file mode 100755 index 9f463a48a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QtSingleApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include "nglsingleapplication.h" - -#include "ngl_signal_handler.inc" - -//---------------------------------------------------------------------------- -NGLSingleApplication::NGLSingleApplication(int &argc, char **argv) - : QtSingleApplication(argc, argv) -{ - // auf SIGTERM reagieren - signal(SIGTERM, &signalHandler); -#ifdef Q_OS_WIN - installNativeEventFilter(new MyEventFilter); -#endif -} - -//---------------------------------------------------------------------------- -bool NGLSingleApplication::notify(QObject *o, QEvent *e) -{ - bool bRet = false; - try - { - bRet = QtSingleApplication::notify(o, e); - } - catch (const std::exception &e) - { - fprintf(stderr, "exception %s\n", e.what()); - } - return bRet; -} diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.h b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.h deleted file mode 100755 index 24714b423..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsingleapplication.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QtSingleApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include -#include "nglloggerhandler.h" - -#ifndef NGLSINGLEAPPLICATION_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define NGLSINGLEAPPLICATION_EXPORT -# else -# ifdef MAKE_NGLSINGLEAPPLICATION_LIB -# define NGLSINGLEAPPLICATION_EXPORT Q_DECL_EXPORT -# else -# define NGLSINGLEAPPLICATION_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif - -namespace NGL -{ -class INGLLogger; -} - -class NGLSINGLEAPPLICATION_EXPORT NGLSingleApplication : public QtSingleApplication, public NGL::LoggerHandler -{ - Q_OBJECT - -public: - NGLSingleApplication(int &argc, char **argv); - -protected: - bool notify(QObject *o, QEvent *e) override; -}; - -#define nglApp static_cast(NGLSingleApplication::instance()) diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.cpp b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.cpp deleted file mode 100755 index bb2770bdc..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QCoreApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ - -#include "nglsinglecoreapplication.h" - -#include "ngl_signal_handler.inc" - -//---------------------------------------------------------------------------- -NGLSingleCoreApplication::NGLSingleCoreApplication(int &argc, char **argv) - : QtSingleCoreApplication(argc, argv) -{ - // auf SIGTERM reagieren - signal(SIGTERM, &signalHandler); -#ifdef Q_OS_WIN - installNativeEventFilter(new MyEventFilter); -#endif -} diff --git a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.h b/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.h deleted file mode 100755 index 8087043a1..000000000 --- a/qt6-after/qt6-migrated-legatus/include/nglapplication/nglsinglecoreapplication.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @RDE_HEADER@ - * small extension to QCoreApplication with NGL specific stuff - * $Id$ - * $HeadURL$ - * $Author$ - */ -#pragma once - -#include -#include "nglloggerhandler.h" - -#ifndef NGLSINGLECOREAPPLICATION_EXPORT -# ifdef BUILD_STATIC_LIBRARIES -# define NGLSINGLECOREAPPLICATION_EXPORT -# else -# ifdef MAKE_NGLSINGLECOREAPPLICATION_LIB -# define NGLSINGLECOREAPPLICATION_EXPORT Q_DECL_EXPORT -# else -# define NGLSINGLECOREAPPLICATION_EXPORT Q_DECL_IMPORT -# endif -# endif -#endif - -namespace NGL -{ -class INGLLogger; -} - -class NGLSINGLECOREAPPLICATION_EXPORT NGLSingleCoreApplication : public QtSingleCoreApplication, public NGL::LoggerHandler -{ - Q_OBJECT - -public: - NGLSingleCoreApplication(int &argc, char **argv); -}; diff --git a/qt6-after/qt6-migrated-legatus/include/poppler/qt5/poppler-qt5.h b/qt6-after/qt6-migrated-legatus/include/poppler/qt5/poppler-qt5.h deleted file mode 100644 index 63dc638e2..000000000 --- a/qt6-after/qt6-migrated-legatus/include/poppler/qt5/poppler-qt5.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef POPPLER_QT5_POPPLER_QT5_H -#define POPPLER_QT5_POPPLER_QT5_H - -/* Compatibility wrapper: include poppler-qt6 header when project includes poppler/qt5/poppler-qt5.h */ -#include - -#endif // POPPLER_QT5_POPPLER_QT5_H diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicBuffer.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicBuffer.hpp deleted file mode 100644 index 01f200924..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicBuffer.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * $Id$ - * - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_DYNAMIC_BUFFER_HPP_ -#define HPP_SERVICE_DYNAMIC_BUFFER_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include "osapi/osapi_heap.h" - -#include -#include -#include - -namespace rti { namespace apputils { - -class DynamicBufferProperty { -public: - - DynamicBufferProperty(int32_t min_size, bool trim_to_size) - :min_size_(min_size), trim_to_size_(trim_to_size) - { - } - - DynamicBufferProperty(const DynamicBufferProperty &property) - :min_size_(property.min_size_), trim_to_size_(property.trim_to_size_) - { - } - - DynamicBufferProperty& min_size(int32_t min_size) - { - min_size_ = min_size; - return *this; - } - int32_t min_size() const - { - return min_size_; - } - - DynamicBufferProperty& trim_to_size(bool trim_to_size) - { - trim_to_size_ = trim_to_size; - return *this; - } - - bool trim_to_size() const - { - return trim_to_size_; - } - -private: - int32_t min_size_; - bool trim_to_size_; -}; - - -class DynamicBuffer { -public: - - DynamicBuffer(const DynamicBufferProperty &property) - :property_(property), buffer_(NULL), buffer_length_(0) - { - ensure_length(property.min_size()); - } - - ~DynamicBuffer() - { - if (buffer_ != NULL) { - RTIOsapiHeap_freeArray(buffer_); - buffer_ = NULL; - } - buffer_length_ = 0; - } - - void ensure_length(int32_t new_length) - { - if (new_length > buffer_length_) { - if (!RTIOsapiHeap_reallocateArray(&buffer_, new_length, char)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_OSAPI_MEMORY_LOG_OUT_OF_HEAP_STRING_d, - new_length); - } - buffer_length_ = new_length; - } - } - - void trim_to_size() - { - if (property_.trim_to_size()) { - if (!RTIOsapiHeap_reallocateArray( - &buffer_, - property_.min_size(), - char)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_OSAPI_MEMORY_LOG_OUT_OF_HEAP_STRING_d, - property_.min_size()); - } - buffer_length_ = property_.min_size(); - } - } - - void release(char *&buffer, int32_t& length) - { - buffer = buffer_; - length = buffer_length_; - buffer_ = NULL; - buffer_length_ = 0; - } - - void own(char *buffer, int32_t length) - { - buffer_ = buffer; - buffer_length_ = length; - } - - char *buffer() - { - return buffer_; - } - - int32_t length() - { - return buffer_length_; - } - -private: - const DynamicBufferProperty property_; - char* buffer_; - int32_t buffer_length_; -}; - - -} } /* namespace rti::apputils */ -#endif /* HPP_SERVICE_DYNAMIC_BUFFER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicDataConverter.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicDataConverter.hpp deleted file mode 100644 index ecc6dcc63..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/DynamicDataConverter.hpp +++ /dev/null @@ -1,247 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_DYNAMIC_DATA_CONVERTER_HPP_ -#define HPP_SERVICE_DYNAMIC_DATA_CONVERTER_HPP_ - - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include "osapi/osapi_heap.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include "apputils/apputils_dynamic_data_converter_impl.h" - -namespace rti { namespace apputils { - -class DynamicDataConverter { -public: - - class ScopedSample { - public: - - ScopedSample( - APPUTILSDynamicDataConverter *converter, - DDS_DynamicData *native) : - converter_(converter), - native_(native) - { - } - - ~ScopedSample() - { - APPUTILSDynamicDataConverter_return_sample(converter_, native_); - } - - dds::core::xtypes::DynamicData& get() - { - return rti::core::native_conversions::cast_from_native< - dds::core::xtypes::DynamicData>(*native_); - } - - private: - APPUTILSDynamicDataConverter *converter_; - DDS_DynamicData *native_; - }; - - class ScopedBuffer { - public: - - ScopedBuffer() : converter_(NULL), native_(NULL), native_length_(0) - { - } - - ScopedBuffer( - APPUTILSDynamicDataConverter *converter, - void *native, - uint32_t native_length) : - converter_(converter), - native_(native), - native_length_(native_length) - { - } - - ~ScopedBuffer() - { - if (native_ != NULL) { - APPUTILSDynamicDataConverter_return_buffer(converter_, native_); - } - } - - void clear() - { - assign(converter_, NULL, 0); - } - - void assign( - APPUTILSDynamicDataConverter *converter, - void *native, - uint32_t native_length) - { - if (native_ != NULL) { - APPUTILSDynamicDataConverter_return_buffer( - converter_, - const_cast(native_)); - } - converter_ = converter; - native_ = native; - native_length_ = native_length; - } - - ScopedBuffer& operator =(ScopedBuffer& other) - { - assign(other.converter_, other.native_, other.native_length_); - return *this; - } - - const void * get() - { - return native_; - } - - template - const T * get() { - return static_cast(native_); - } - - uint32_t length() - { - return native_length_; - } - - private: - APPUTILSDynamicDataConverter *converter_; - void *native_; - uint32_t native_length_; - }; - - /** - * The dynamic data converter allows for deferred initialization. When doing - * so, it can be initialized at any moment by calling the set() method. - */ - DynamicDataConverter() : initialized_(false) {} - - /** - * Direct initialization constructor. A valid type-code has to be provided - * (not null and it has to be a non-primitive and non null type-kind type). - */ - DynamicDataConverter( - const dds::core::xtypes::DynamicType& type_code, - const DynamicBufferProperty &property) : - initialized_(false) - { - set(type_code, property); - } - - /** - * Initialize this dynamic data converter. A valid type-code has to be - * provided (not null and it has to be a non-primitive and non null - * type-kind type). - * If the converter has already been initialized, this method is a no-op. - */ - void set( - const dds::core::xtypes::DynamicType& type_code, - const DynamicBufferProperty &property) - { - if (!initialized_) { - if (!APPUTILSDynamicDataConverter_initialize( - &converter_, - &(type_code.native()), - (RTI_UINT32) property.min_size())) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "native converter"); - } - initialized_ = true; - } - } - - ~DynamicDataConverter() - { - if (initialized_) { - APPUTILSDynamicDataConverter_finalize(&converter_); - } - } - - ScopedSample sample( - const dds::core::xtypes::DynamicData& sample, - const DDS_DataRepresentationId_t target_representation) - { - DDS_DynamicData *native = APPUTILSDynamicDataConverter_get_sample( - &converter_, - const_cast(&sample.native()), - target_representation); - if (native == NULL) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "get native sample"); - } - return ScopedSample(&converter_, native); - } - - ScopedBuffer buffer( - const dds::core::xtypes::DynamicData& sample, - const DDS_DataRepresentationId_t target_representation) - { - DDS_UnsignedLong native_length = 0; - void *native = APPUTILSDynamicDataConverter_get_buffer( - &converter_, - &native_length, - const_cast(&sample.native()), - target_representation); - if (native == NULL) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "get native buffer"); - } - return ScopedBuffer(&converter_, native, (uint32_t) native_length); - } - - void buffer( - ScopedBuffer& scoped_buffer, - const dds::core::xtypes::DynamicData& sample, - const DDS_DataRepresentationId_t target_representation) - { - DDS_UnsignedLong native_length = 0; - /* - * The scoped buffer has to be cleared before we can use it again. The - * buffer will automatically be returned to this converter. After this, - * we can safely get the buffer again from the dynamic data sample and - * reassign to the scoped buffer. - */ - scoped_buffer.clear(); - void *native = APPUTILSDynamicDataConverter_get_buffer( - &converter_, - &native_length, - const_cast(&sample.native()), - target_representation); - if (native == NULL) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "get native buffer"); - } - scoped_buffer.assign(&converter_, native, (uint32_t) native_length); - } - -private: - APPUTILSDynamicDataConverter converter_; - bool initialized_; -}; - - -} } /* namespace rti::apputils */ -#endif /* HPP_SERVICE_DYNAMIC_DATA_CONVERTER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/EntityId.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/EntityId.hpp deleted file mode 100644 index 3cd3e4175..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/EntityId.hpp +++ /dev/null @@ -1,243 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - * - */ - -#ifndef HPP_SERVICE_ENTITY_ID_HPP_ -#define HPP_SERVICE_ENTITY_ID_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include "rtixmlutils/rtixmlutils_object.h" - -namespace rti { namespace apputils { - -class EntityFullNameIterator { -public: - - EntityFullNameIterator(const std::string& full_name) - : full_name_(full_name), substring_pos_(0), next_substring_pos_(0) - { - next(); - } - - ~EntityFullNameIterator() - { - } - - bool is_end() const - { - return substring_pos_ == full_name_.length(); - } - - EntityFullNameIterator& end() - { - substring_pos_ = full_name_.length(); - next_substring_pos_ = substring_pos_; - - return *this; - } - - EntityFullNameIterator& last() - { - next_substring_pos_ = full_name_.length(); - substring_pos_ = next_substring_pos_; - - for (; substring_pos_ > 0; --substring_pos_) { - if (full_name_[substring_pos_] == '\"') { - size_t opening_quotes = full_name_.rfind( - "\"", - substring_pos_ - 1); - if (opening_quotes == std::string::npos) { - DDSLog_warn( - &RTI_LOG_ANY_s, - "detected unbalanced escaped name. Missing closing '\"'?"); - } else { - // skip all characters in escaped name - substring_pos_ = opening_quotes; - } - } else if (full_name_.find( - RTIXMLUTILS_OBJECT_NAME_SEPARATOR, - substring_pos_) == substring_pos_) { - substring_pos_ += strlen(RTIXMLUTILS_OBJECT_NAME_SEPARATOR); - break; - } - } - - return *this; - } - - - std::string parent() - { - size_t parent_length = (substring_pos_ == 0) - ? 0 - : substring_pos_ - strlen(RTIXMLUTILS_OBJECT_NAME_SEPARATOR); - return full_name_.substr(0, parent_length); - } - - std::string operator*() const - { - size_t substring_pos = substring_pos_; - size_t name_length = next_substring_pos_ - substring_pos_; - if (name_length > 1 - && full_name_[substring_pos_ + name_length - 1] == '\"' - && full_name_[substring_pos_] == '\"') { - name_length -= 2; - ++substring_pos; - - } - return full_name_.substr(substring_pos, name_length); - } - - EntityFullNameIterator& operator++() - { - next(); - return *this; - } - - std::string escaped() - { - size_t substring_pos = substring_pos_; - size_t name_length = next_substring_pos_ - substring_pos_; - - return full_name_.substr(substring_pos, name_length); - } - - - friend bool operator==( - const EntityFullNameIterator &s1, - const EntityFullNameIterator &s2) - { - return s1.substring_pos_ == s2.substring_pos_ - && s1.next_substring_pos_ == s2.next_substring_pos_ - && &s1.full_name_ == &s2.full_name_; - } - - friend bool operator!=( - const EntityFullNameIterator &s1, - const EntityFullNameIterator &s2) - { - return !(s1 == s2); - } - - -private: - - void next() - { - if (full_name_.find( - RTIXMLUTILS_OBJECT_NAME_SEPARATOR, - next_substring_pos_) == next_substring_pos_) { - next_substring_pos_ += strlen(RTIXMLUTILS_OBJECT_NAME_SEPARATOR); - } - substring_pos_ = next_substring_pos_; - - for (; next_substring_pos_ < full_name_.length(); ++next_substring_pos_) { - if (full_name_[next_substring_pos_] == '\"') { - size_t closing_quotes = full_name_.find( - "\"", - next_substring_pos_ + 1); - if (closing_quotes == std::string::npos) { - DDSLog_warn( - &RTI_LOG_ANY_s, - "detected unbalanced escaped name. Missing closing '\"'?"); - } else { - // skip all characters in escaped name - next_substring_pos_ = closing_quotes; - } - } else if (full_name_.find( - RTIXMLUTILS_OBJECT_NAME_SEPARATOR, - next_substring_pos_) == next_substring_pos_) { - break; - } - } - } - -private: - const std::string& full_name_; - size_t substring_pos_; - size_t next_substring_pos_; -}; - -template -class EntityId { -public: - typedef EntityFullNameIterator name_iterator; - -public: - - EntityId(const std::string& the_full_name, ENTITY_KIND_TYPE the_kind) - : full_name_(the_full_name), kind_(the_kind) - { - } - - bool is_nil() const - { - return kind_ == ENTITY_KIND_TYPE::count_; - } - - name_iterator begin() const - { - return EntityFullNameIterator(full_name_); - } - - name_iterator end() const - { - return EntityFullNameIterator(full_name_).end(); - } - - const std::string& full_name() const - { - return full_name_; - } - - const std::string name() const - { - return (*EntityFullNameIterator(full_name_).last()); - } - - const std::string parent_name() const - { - return EntityFullNameIterator(full_name_).last().parent(); - } - - const ENTITY_KIND_TYPE& kind() const - { - return kind_; - } - - static EntityId nil() - { - static EntityId nil( - "", - ENTITY_KIND_TYPE::count_); - - return nil; - } - - friend bool operator==( - const EntityId& left, - const EntityId& right) - { - return left.kind_ == right.kind_ - && left.full_name_ == right.full_name_; - } - -private: - std::string full_name_; - ENTITY_KIND_TYPE kind_; -}; - -} } /* namespace rti::apputils */ - - -#endif //HPP_SERVICE_ENTITY_ID_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/ResourceIdentifier.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/ResourceIdentifier.hpp deleted file mode 100644 index 0a4cd23fd..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/ResourceIdentifier.hpp +++ /dev/null @@ -1,395 +0,0 @@ -/* - * $Id$ - * - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_RESOURCE_IDENTIFIER_HPP_ -#define HPP_SERVICE_RESOURCE_IDENTIFIER_HPP_ - - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include - -#include "reda/reda_inlineList.h" -#include "apputils/apputils_resource_identifier_impl.h" - -#include -#include -#include -#include - -namespace rti { namespace apputils { - -class ResourceIdentifier; - -class RelativeResource { -public: - - typedef const APPUTILSRelativeResourceInfo native_type; - - - RelativeResource(native_type *native_value) - : native_relative_resource_(native_value) - { - } - - ~RelativeResource() - { - } - - RelativeResource(const RelativeResource &other) - : native_relative_resource_(other.native_relative_resource_) - { - } - - RelativeResource operator * () const - { - return RelativeResource(*this); - } - - RelativeResource & operator = (const RelativeResource& other) - { - native_relative_resource_ = other.native_relative_resource_; - return *this; - } - - RelativeResource& operator ++ () - { - native_relative_resource_ = next(); - return *this; - } - - RelativeResource& operator -- () - { - native_relative_resource_ = prev(); - return *this; - } - - friend bool operator == ( - const RelativeResource & s1, - const RelativeResource & s2) - { - return s1.native_relative_resource_ == s2.native_relative_resource_; - } - - friend bool operator != ( - const RelativeResource & s1, - const RelativeResource & s2) - { - return !(s1 == s2); - } - - std::string name() const - { - return APPUTILSRelativeResourceInfo_get_name( - native_relative_resource_); - } - - std::string kind() const - { - return APPUTILSRelativeResourceInfo_get_kind( - native_relative_resource_); - } - - RelativeResource& last() - { - REDAInlineListNode *last = (struct REDAInlineListNode *) - REDAInlineList_getLast( - native_relative_resource_->_node.inlineList); - assert(last != NULL); - native_relative_resource_ = reinterpret_cast(last); - return *this; - } - - RelativeResource& begin() - { - REDAInlineListNode *first = (struct REDAInlineListNode *) - REDAInlineList_getFirst( - native_relative_resource_->_node.inlineList); - assert(first != NULL); - native_relative_resource_ = reinterpret_cast (first); - return *this; - } - - friend const std::string to_string( - const RelativeResource& relative_id) - { - return relative_id.kind() + "/" + relative_id.name(); - } - - friend class ResourceIdentifier; -private: - - static RelativeResource nil() - { - static RelativeResource nil(NULL); - - return nil; - } - - native_type *next() - { - return reinterpret_cast( - REDAInlineListNode_getNext(&native_relative_resource_->_node)); - } - - native_type * prev() - { - void *prev = - REDAInlineListNode_getPrev(&native_relative_resource_->_node); - if (prev != NULL) { - return reinterpret_cast (prev); - } - - return native_relative_resource_; - } - -private: - native_type *native_relative_resource_; -}; - -class ResourceIdentifier { -public: - typedef APPUTILSResourceIdentifier native_type; - typedef RelativeResource iterator; - typedef RelativeResource relative_resource; - -public: - - ResourceIdentifier() - { - if (!APPUTILSResourceIdentifier_initialize(&native_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "native resource identifier"); - } - } - - ResourceIdentifier(const std::string& formatted_uri) - { - if (!APPUTILSResourceIdentifier_initialize(&native_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "native resource identifier"); - } - if (!APPUTILSResourceIdentifier_parse_formatted_identifier( - &native_, - formatted_uri.c_str())) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_SERVICE_LOG_MALFORMED_RESOURCE_IDENTIFIER_s, - formatted_uri.c_str()); - } - parse(formatted_uri); - } - - ResourceIdentifier(const ResourceIdentifier& other) - { - if (!APPUTILSResourceIdentifier_initialize(&native_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "native resource identifier"); - } - append(other); - } - - ResourceIdentifier( - const ResourceIdentifier& parent, - const ResourceIdentifier& child) - { - if (!APPUTILSResourceIdentifier_initialize(&native_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "native resource identifier"); - } - append(parent); - append(child); - } - - ResourceIdentifier( - const std::string& kind, - const std::string& name) - { - if (!APPUTILSResourceIdentifier_initialize(&native_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "native resource identifier"); - } - add(kind, name); - } - - ResourceIdentifier( - const ResourceIdentifier::relative_resource& relative_resource) - { - if (!APPUTILSResourceIdentifier_initialize(&native_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "native resource identifier"); - } - add(relative_resource); - } - - ResourceIdentifier& parse(const std::string& formatted_uri) - { - if (!APPUTILSResourceIdentifier_parse_formatted_identifier( - &native_, - formatted_uri.c_str())) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_SERVICE_LOG_MALFORMED_RESOURCE_IDENTIFIER_s, - formatted_uri.c_str()); - } - - return *this; - } - - ~ResourceIdentifier() - { - APPUTILSResourceIdentifier_finalize(&native_); - } - - iterator last() const - { - return iterator(APPUTILSResourceIdentifier_get_resource( - const_cast (&native_))); - - } - - iterator end() const - { - return iterator::nil(); - } - - iterator begin() const - { - iterator last = this->last(); - if (last != end()) { - return last.begin(); - } - - return last; - } - - ResourceIdentifier parent() const - { - ResourceIdentifier parent_id; - iterator it = begin(); - for (; it != last(); ++it) { - parent_id += ResourceIdentifier(it.kind(), it.name()); - } - - return parent_id; - } - - std::string fully_qualified_name() const - { - const auto result = APPUTILSResourceIdentifier_get_fully_qualified_name( - const_cast(&native_)); - return (result == nullptr) ? "" : result; - } - - std::string fully_qualified_kind() const - { - const auto result = APPUTILSResourceIdentifier_get_fully_qualified_kind( - const_cast(&native_)); - return (result == nullptr) ? "" : result; - } - - std::string custom_method() const - { - const auto result = APPUTILSResourceIdentifier_get_custom_method( - const_cast(&native_)); - return (result == nullptr) ? "" : result; - } - - ResourceIdentifier& operator+=( - const ResourceIdentifier& right) - { - return append(right); - } - - friend std::ostream& operator<<( - std::ostream& os, - const ResourceIdentifier& resource_id) - { - os << to_string(resource_id); - - return os; - } - - friend const std::string to_string( - const ResourceIdentifier& resource_id) - { - const char* resource_id_str = to_native_string(resource_id); - if (resource_id_str != NULL) { - return std::string(resource_id_str); - } else { - return std::string(""); - } - - } - - friend const char* to_native_string( - const ResourceIdentifier& resource_id) - { - return APPUTILSResourceIdentifier_to_string( - const_cast(&resource_id.native_)); - } - - native_type& native() const - { - return const_cast(native_); - } - - -private: - - ResourceIdentifier& add( - const std::string& kind, - const std::string& name = "") - { - if (!APPUTILSResourceIdentifier_add_relative_resource( - &native_, - kind.c_str(), - name.c_str())) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ADD_FAILURE_s, - "relative resource"); - } - - return *this; - } - - ResourceIdentifier& add( - const ResourceIdentifier::relative_resource& relative_resource) - { - add(relative_resource.kind(), relative_resource.name()); - return *this; - } - - ResourceIdentifier& append( - const ResourceIdentifier& right) - { - ResourceIdentifier::iterator it = right.begin(); - for (; it != end(); ++it) { - add(it); - } - - return *this; - } - - native_type native_; - -}; - -} } /* namespace rti::apputils */ - - -#endif /* HPP_SERVICE_RESOURCE_IDENTIFIER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/SQLiteConnection.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/SQLiteConnection.hpp deleted file mode 100644 index 6c2bcb068..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/SQLiteConnection.hpp +++ /dev/null @@ -1,1065 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_RTI_APPUTILS_SQLiteConnection_HPP_ -#define HPP_RTI_APPUTILS_SQLiteConnection_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ndds/ndds_utility_c.h" -#include "dds_c/dds_c_log.h" - -#include -#include -#include -#include - -#include "apputils/apputils_dll.h" - -#include "dds/core/SafeEnumeration.hpp" -#include "dds/core/String.hpp" -#include "osapi/osapi_host.h" -#include "rtisqlite/sqlite3.h" -#include "rti/apputils/util/LockedBuffer.hpp" -#include "rti/apputils/util/Path.hpp" - -struct sqlite3; - - -namespace rti { namespace apputils { - -class APPUTILSDllExport SQLiteConnection { -public: - class SQLiteException: public std::exception { - public: - - SQLiteException() : - sqlite_error_(), - sqlite_error_code(SQLITE_OK), - sql_statement_() {} - - SQLiteException(const SQLiteException& other) : - sqlite_error_(other.sqlite_error_), - sqlite_error_code(other.sqlite_error_code), - sql_statement_(other.sql_statement_), - what_(other.what_) {} - - SQLiteException( - int return_code, - const std::string error_string, - const std::string sql_statement): - sqlite_error_(error_string), - sqlite_error_code(return_code), - sql_statement_(sql_statement) - { - what_string_stream << "SQLite error: " + sqlite_error_; - what_string_stream << std::endl; - what_string_stream << " [SQLite return code = " << sqlite_error_code - << "]" << std::endl; - if (!sql_statement_.empty()) { - what_string_stream << " [SQL statement = " << sql_statement_ - << "]" << std::endl; - } - set_what(); - } - - ~SQLiteException() throw() {} - - virtual const char * what() const throw() - { - return what_.c_str(); - } - - protected: - void set_what() { - size_t what_size = what_string_stream.str().size() + 1; - what_.resize(what_size); - strncpy(&what_[0], what_string_stream.str().c_str(), what_size); - } - - std::string sqlite_error_; - int sqlite_error_code; - std::string sql_statement_; - std::stringstream what_string_stream; - std::string what_; - }; - - class SQLiteOpenException: public SQLiteException { - public: - SQLiteOpenException( - const int return_code, - const std::string error_string, - const std::string filename) - : filename_(filename) - { - sqlite_error_ = error_string; - sqlite_error_code = return_code; - - what_string_stream << "SQLite - failed to open DB file; " - "sqlite returned error: " - + sqlite_error_; - what_string_stream << std::endl; - what_string_stream << " [SQLite return code = " - << sqlite_error_code << "]" << std::endl; - what_string_stream << " [File = " << filename_ << "]" - << std::endl; - set_what(); - } - - ~SQLiteOpenException() throw() {} - - private: - std::string filename_; - }; - - class SQLiteCloseException: public SQLiteException { - public: - SQLiteCloseException( - const int return_code, - const std::string error_string) - { - sqlite_error_ = error_string; - sqlite_error_code = return_code; - - what_string_stream - << "SQLite - failed to open DB; error: " - + sqlite_error_; - what_string_stream << std::endl; - what_string_stream << " [SQLite return code = " - << sqlite_error_code << "]" << std::endl; - set_what(); - } - - ~SQLiteCloseException() throw() {} - - }; - - class SQLiteBindException: public SQLiteException { - public: - SQLiteBindException( - int return_code, - const std::string error_string, - const std::string sql_statement, - int column) - { - sqlite_error_ = error_string; - sqlite_error_code = return_code; - sql_statement_ = sql_statement; - - what_string_stream << "SQLite error: " + sqlite_error_; - what_string_stream << std::endl; - what_string_stream << " [SQLite return code = " - << sqlite_error_code << "]" << std::endl; - if (!sql_statement_.empty()) { - what_string_stream << " [SQL statement = " << sql_statement_ - << "]" << std::endl; - } - what_string_stream << " [Column being bound: " << column << "]" - << std::endl; - set_what(); - }; - }; - - static void delete_sqlite3(sqlite3 *sqlite) - { - if (sqlite != nullptr) { - if (sqlite3_close_v2(sqlite) != SQLITE_OK) { - const char *db_name = sqlite3_db_filename(sqlite, nullptr); - DDSLogger_log( - RTI_LOG_BIT_EXCEPTION, - &RTI_LOG_FAILED_TO_CLOSE_FILE_TEMPLATE, - NULL, /* worker */ - "Error closing SQLite DB; file name = %s", - (db_name != nullptr ? db_name : "")); - } - } - } - - static void delete_statement(sqlite3_stmt *statement) - { - if (statement != nullptr) { - sqlite3_finalize(statement); - } - } - - /** - * This class opens an exclusive SQLite transaction within the constructor, - * on the SQLite connection given as a parameter to it. - * The transaction is closed when the object comes out of scope, and the - * destructor is called. It provides an error setting method. When there has - * been an error, the transaction will be rolled back. When everything went - * fine, the destructor will commit normally. - */ - class TransactionToken { - public: - TransactionToken(SQLiteConnection& connection) - : connection_(connection), - error_(false) - { - connection_.begin(); - } - ~TransactionToken() - { - if (error_) { - connection_.rollback(); - } else { - connection_.commit(); - } - } - void set_error(bool error) - { - error_ = error; - } - private: - SQLiteConnection& connection_; - bool error_; - }; - - /** - * @brief This class is a listener for the SQLiteConnection class. It is - * used to notify when the associated connection is disconnected. - * Notified objects should release all SQLite resources before returning. - */ - class AbstractSQLiteDisconnectListener { - public: - /** - * @brief Constructor - * - * @param connection The SQLite connection to listen to - * @param ephimerous If true, this object will not be added to the - * connection's list of listeners. This is useful for objects that - * guarantee they will not outlive the connection. Default: false. - */ - AbstractSQLiteDisconnectListener( - SQLiteConnection& connection, - bool ephemerous = true) - : connection_(connection), ephemerous_(ephemerous) - { - if (!ephemerous_) { - connection_.add_disconnect_listener(this); - } - } - - virtual ~AbstractSQLiteDisconnectListener() - { - if (!ephemerous_) { - connection_.remove_disconnect_listener(this); - } - } - - virtual void on_disconnect() = 0; - - private: - SQLiteConnection& connection_; - bool ephemerous_; - }; - - class RowIterator : public AbstractSQLiteDisconnectListener { - public: - - /** - * @brief Constructor (from a statement). - * - * @param statement[in] The statement to iterate over. - * @param connection[in] The connection to the database. - * @param auto_step[in] If true, the iterator will step to the first row - * when created. Default: true. - * @param ephemerous[in] If true, this object will not be added to the - * connection's list of listeners. This is useful for objects that - * guarantee they will not outlive the connection. Default: true. - * - * @throws SQLiteException if there is an error resetting the statement. - * @throws rti::core::PreconditionNotMetException if the statement is - * invalid. - */ - RowIterator( - const std::shared_ptr& statement, - SQLiteConnection& connection, - bool auto_step = true, - bool ephemerous = true) - : AbstractSQLiteDisconnectListener(connection, ephemerous), - statement_(statement), - connection_(connection), - return_code_(SQLITE_OK), - is_bound_(false), - is_output_stmt_(false) - { - initialize(auto_step); - } - - /** - * @brief Constructor (from SQL). - * - * @param statement[in] The SQL statement to iterate over. - * @param connection[in] The connection to the database. - * @param auto_step[in] If true, the iterator will step to the first row - * when created. Default: true. - * @param ephemerous[in] If true, this object will not be added to the - * connection's list of listeners. This is useful for objects that - * guarantee they will not outlive the connection. Default: true. - * - * @throws SQLiteException if there is an error preparing the statement. - */ - RowIterator( - const std::string& statement, - SQLiteConnection& connection, - bool auto_step = true, - bool ephemerous = true) - : AbstractSQLiteDisconnectListener(connection, ephemerous), - statement_(connection.prepare(statement)), - connection_(connection), - return_code_(SQLITE_OK), - is_bound_(false), - is_output_stmt_(false) - { - initialize(auto_step); - } - - RowIterator& operator=(const RowIterator& other) = delete; - - virtual void on_disconnect() override - { - statement_ = nullptr; - } - - bool is_valid() const - { - return statement_.get() != nullptr && connection_.connected(); - } - - int num_columns() const - { - RTI_CHECK_PRECONDITION(is_valid()); - return sqlite3_column_count(statement_.get()); - } - - void bind(const int column, const int64_t value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int ret_code = sqlite3_bind_int64( - statement_.get(), - column, - static_cast(value)); - if (ret_code != SQLITE_OK) { - std::string sql(sqlite3_sql(statement_.get())); - throw SQLiteBindException( - ret_code, - connection_.last_err_msg(), - sql, - column); - } - is_bound_ = true; - } - - void bind(const int column, const double value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int ret_code = sqlite3_bind_double(statement_.get(), column, value); - if (ret_code != SQLITE_OK) { - std::string sql(sqlite3_sql(statement_.get())); - throw SQLiteBindException( - ret_code, - connection_.last_err_msg(), - sql, - column); - } - is_bound_ = true; - } - - void bind(const int column, const std::string& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int ret_code = sqlite3_bind_text( - statement_.get(), - column, - value.c_str(), - static_cast(value.size()), - SQLITE_TRANSIENT); - if (ret_code != SQLITE_OK) { - std::string sql(sqlite3_sql(statement_.get())); - throw SQLiteBindException( - ret_code, - connection_.last_err_msg(), - sql, - column); - } - is_bound_ = true; - } - - void bind(const int column, const std::vector& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - void *value_array = nullptr; - if (value.size() > 0) { - value_array = (void *) (&(value[0])); - } - int ret_code = sqlite3_bind_blob( - statement_.get(), - column, - value_array, - static_cast(value.size()), - SQLITE_TRANSIENT); - if (ret_code != SQLITE_OK) { - std::string sql(sqlite3_sql(statement_.get())); - throw SQLiteBindException( - ret_code, - connection_.last_err_msg(), - sql, - column); - } - is_bound_ = true; - } - - void bind( - const int column, - const rti::apputils::util::LockedBuffer& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int ret_code = sqlite3_bind_blob( - statement_.get(), - column, - value.buffer(), - static_cast(value.size()), - SQLITE_STATIC); - if (ret_code != SQLITE_OK) { - std::string sql(sqlite3_sql(statement_.get())); - throw SQLiteBindException( - ret_code, - connection_.last_err_msg(), - sql, - column); - } - is_bound_ = true; - } - - bool is_null(const int column) - { - RTI_CHECK_PRECONDITION(is_valid()); - return sqlite3_column_type(statement_.get(), column) == SQLITE_NULL; - } - - /** - * Get an integer value from the current iterator position. - * - * @param column The index of the column to get the value from. Leftmost - * column is indexed by 0. - */ - void get(const int column, int64_t& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - value = static_cast( - sqlite3_column_int64(statement_.get(), column)); - } - /** - * Get a floating-point value from the current iterator position. - * - * @param column The index of the column to get the value from. Leftmost - * column is indexed by 0. - */ - void get(const int column, double& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - value = sqlite3_column_double(statement_.get(), column); - } - /** - * Get a text value from the current iterator position. - * - * @param column The index of the column to get the value from. Leftmost - * column is indexed by 0. - */ - void get(const int column, std::string& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int length = sqlite3_column_bytes(statement_.get(), column); - if (length > 0) { - const char *c_tmp = (const char *) - sqlite3_column_text(statement_.get(), column); - if (c_tmp == nullptr) { - std::string sql(sqlite3_sql(statement_.get())); - throw SQLiteException( - SQLITE_ERROR, - connection_.last_err_msg(), - sql); - } - value.assign(c_tmp, c_tmp + strlen(c_tmp)); - } - } - /** - * Get a wide-string value from the current iterator position. - * - * @param column The index of the column to get the value from. Leftmost - * column is indexed by 0. - */ - void get(const int column, dds::core::wstring& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int length = sqlite3_column_bytes(statement_.get(), column); - if (length > 0) { - DDS_UnsignedShort *utf16_string = - (DDS_UnsignedShort *) sqlite3_column_text16( - statement_.get(), - column); - if (utf16_string == nullptr) { - std::string sql(sqlite3_sql(statement_.get())); - throw SQLiteException( - SQLITE_ERROR, - connection_.last_err_msg(), - sql); - } - /* - * The value returned by sqlite3_column_bytes16 cannot be - * negative - */ - uint32_t utf16_string_length = - (static_cast(sqlite3_column_bytes16( - statement_.get(), - column))) - >> 1; - dds::core::wstring tmp(utf16_string_length); - for (uint32_t i = 0; i < utf16_string_length; ++i) { - tmp.native()[i] = static_cast(utf16_string[i]); - } - value = tmp; - } - } - /** - * Get a blob value from the current iterator position. - * - * @param column The index of the column to get the value from. Leftmost - * column is indexed by 0. - */ - void get(const int column, std::vector& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int length = sqlite3_column_bytes(statement_.get(), column); - if (length > 0) { - uint8_t *c_array = (uint8_t *) - sqlite3_column_blob(statement_.get(), column); - value.assign(c_array, c_array + length); - } - } - /** - * Get a blob pointer value from the current iterator position. - * - * @param column The index of the column to get the value from. Leftmost - * column is indexed by 0. - */ - void get( - const int column, - rti::apputils::util::LockedBuffer& value) - { - RTI_CHECK_PRECONDITION(is_valid()); - - int length = sqlite3_column_bytes(statement_.get(), column); - if (length > 0) { - uint8_t *c_array = (uint8_t *) - sqlite3_column_blob(statement_.get(), column); - /* We know length is positive */ - value.set(c_array, static_cast(length)); - } - } - - bool has_no_data(const int column) - { - RTI_CHECK_PRECONDITION(is_valid()); - return (sqlite3_column_bytes(statement_.get(), column) == 0); - } - - /** - * Step the iterator. - */ - RowIterator& operator ++() - { - RTI_CHECK_PRECONDITION(is_valid()); - - return_code_ = sqlite3_step(statement_.get()); - switch (return_code_) { - case (SQLITE_OK): - break; - case (SQLITE_ROW): - break; - case (SQLITE_DONE): - break; - default: - throw SQLiteException( - return_code_, - connection_.last_err_msg(), - sqlite3_sql(statement_.get())); - } - if (is_bound_ && is_output_stmt_) { - int ret_code = sqlite3_reset(statement_.get()); - if (ret_code != SQLITE_OK) { - throw SQLiteException( - ret_code, - connection_.last_err_msg(), - sqlite3_sql(statement_.get())); - } - sqlite3_clear_bindings(statement_.get()); - } - return *this; - } - - bool at_end() { - return return_code_ == SQLITE_DONE; - } - - void reset() { - RTI_CHECK_PRECONDITION(is_valid()); - - int ret_code = sqlite3_reset(statement_.get()); - if (ret_code != SQLITE_OK) { - throw SQLiteException( - ret_code, - connection_.last_err_msg(), - sqlite3_sql(statement_.get())); - } - sqlite3_clear_bindings(statement_.get()); - return_code_ = SQLITE_OK; - } - - private: - std::shared_ptr statement_; - SQLiteConnection& connection_; - int return_code_; - bool is_bound_; - - /** - * This is true only when the statement is an INSERT statement - */ - bool is_output_stmt_; - - void initialize(const bool auto_step) - { - RTI_CHECK_PRECONDITION(is_valid()); - - return_code_ = sqlite3_reset(statement_.get()); - if (return_code_ != SQLITE_OK) { - throw SQLiteException( - return_code_, - connection_.last_err_msg(), - sqlite3_sql(statement_.get())); - } - if (REDAString_iFindSubString( - sqlite3_sql(statement_.get()), - "INSERT INTO ") == nullptr - && REDAString_iFindSubString( - sqlite3_sql(statement_.get()), - "DELETE FROM ") == nullptr) { - if (auto_step) { - ++(*this); - } - } else { - is_output_stmt_ = true; - } - } - }; - - SQLiteConnection() - : connection_(nullptr, delete_sqlite3), - connected_(false), - sqlite_init_string_(default_init_string) - { } - - SQLiteConnection(const std::string& sqlite_init_string) - : connection_(nullptr, delete_sqlite3), - connected_(false), - sqlite_init_string_(sqlite_init_string) - { } - - SQLiteConnection(const SQLiteConnection& other) = delete; - - SQLiteConnection(SQLiteConnection&& other) - : connection_(nullptr, delete_sqlite3), - connected_(other.connected_), - sqlite_init_string_(other.sqlite_init_string_) - { - connection_.reset(other.connection_.release()); - } - - ~SQLiteConnection() - { - if (connected_) { - disconnect(); - } - } - - SQLiteConnection& operator=(SQLiteConnection& other) = delete; - - SQLiteConnection& operator=(SQLiteConnection&& other) - { - connection_.reset(other.connection_.release()); - sqlite_init_string_ = other.sqlite_init_string_; - return *this; - } - - void connect( - const std::string& filename, - bool create_on_open = true, - bool readonly = false) - { - struct sqlite3 *connection = nullptr; - std::string sql; - - if (create_on_open && readonly) { - throw std::runtime_error( - "precondition not met: not (create_on_open and readonly)"); - } - - // Setup the SQLite open function flags - int open_flags = 0; - std::string stringified_open_flags(" for "); - if (create_on_open) { - /* - * Create the file when opening it. Replay and Converter _should not_ - * use this - */ - open_flags = open_flags | SQLITE_OPEN_CREATE; - stringified_open_flags += "create "; - } - if (readonly) { - open_flags = open_flags | SQLITE_OPEN_READONLY; - stringified_open_flags += "readonly "; - } else { - open_flags = open_flags | SQLITE_OPEN_READWRITE; - stringified_open_flags += "read+write "; - } - int sqlite3_open_retcode = sqlite3_open_v2( - filename.c_str(), - &connection, - open_flags, - nullptr); - if (sqlite3_open_retcode != SQLITE_OK) { - std::stringstream location_to_report; -#if !defined(RTI_INTY) - location_to_report << filename << " from working directory "; - location_to_report << rti::apputils::util::Path::cwd(); -#else - location_to_report << filename << " "; -#endif - location_to_report << stringified_open_flags; - sqlite3_close_v2(connection); - throw SQLiteOpenException( - sqlite3_open_retcode, - sqlite3_errstr(sqlite3_open_retcode), - location_to_report.str()); - } - connection_.reset(connection); - - if (sqlite3_busy_handler( - connection, - SQLiteConnection::busy_handler, - nullptr) != SQLITE_OK) { - std::stringstream location_to_report; -#if !defined(RTI_INTY) - location_to_report << filename << " from working directory "; - location_to_report << rti::apputils::util::Path::cwd(); -#else - location_to_report << filename << " "; -#endif - location_to_report << stringified_open_flags; - throw SQLiteOpenException( - sqlite3_errcode(connection_.get()), - sqlite3_errmsg(connection_.get()), - location_to_report.str()); - } - - // RECNEXTGEN-72 [Juanlu]: for the EAR 1, default to the most performant - // SQLite settings. We will need to document that we're setting them - exec(sqlite_init_string_); - - connected_ = true; - } - - bool connected() const - { - return connected_; - } - - const std::string db_filename() const - { - const char *sqlite_file = - sqlite3_db_filename(connection_.get(), nullptr); - if (sqlite_file != nullptr) { - return std::string(sqlite_file); - } - return std::string(); - } - - void add_disconnect_listener(AbstractSQLiteDisconnectListener *listener) - { - disconnect_listeners_.push_back(listener); - } - - void remove_disconnect_listener(AbstractSQLiteDisconnectListener *listener) - { -#if defined(__cplusplus) && __cplusplus >= 201103L - - const auto it = std::find( - disconnect_listeners_.begin(), - disconnect_listeners_.end(), - listener); - if (it == disconnect_listeners_.end()) { - DDSLogger_log( - RTI_LOG_BIT_WARN, - &RTI_LOG_FAILED_TO_FIND_TEMPLATE, - NULL, /* worker */ - "disconnect listener"); - return; - } - disconnect_listeners_.erase(it); -#else - /* - * Web Integration Service uses SQLiteConnection but is written in pre - * C++11 standard - */ - for (std::vector::iterator it = - disconnect_listeners_.begin(); - it != disconnect_listeners_.end(); - ++it) { - if (*it == listener) { - disconnect_listeners_.erase(it); - break; - } - } -#endif - } - - void disconnect() - { - for (AbstractSQLiteDisconnectListener *listener : - disconnect_listeners_) { - listener->on_disconnect(); - } - connection_.reset(nullptr); - connected_ = false; - } - - void begin() - { - std::string sql("BEGIN"); - int retcode = sqlite3_exec( - connection_.get(), - sql.c_str(), - nullptr, - nullptr, - nullptr); - if (retcode != SQLITE_OK && retcode != SQLITE_BUSY) { - throw SQLiteException( - sqlite3_errcode(connection_.get()), - sqlite3_errmsg(connection_.get()), - sql); - } - while (retcode == SQLITE_BUSY) { - retcode = sqlite3_exec( - connection_.get(), - sql.c_str(), - nullptr, - nullptr, - nullptr); - if (retcode != SQLITE_OK && retcode != SQLITE_BUSY) { - throw SQLiteException( - sqlite3_errcode(connection_.get()), - sqlite3_errmsg(connection_.get()), - sql); - } - } - } - - void commit() - { - const std::string sql("COMMIT"); - - if (sqlite3_exec( - connection_.get(), - sql.c_str(), - nullptr, - nullptr, - nullptr) != SQLITE_OK) { - throw SQLiteException( - sqlite3_errcode(connection_.get()), - sqlite3_errmsg(connection_.get()), - sql); - } - } - - void rollback() - { - const std::string sql("ROLLBACK"); - - if (sqlite3_exec( - connection_.get(), - sql.c_str(), - nullptr, - nullptr, - nullptr) != SQLITE_OK) { - throw SQLiteException( - sqlite3_errcode(connection_.get()), - sqlite3_errmsg(connection_.get()), - sql); - } - } - - std::shared_ptr prepare(const std::string& statement_text) - { - sqlite3_stmt *statement = nullptr; - - if (sqlite3_prepare_v2( - connection_.get(), - statement_text.c_str(), - (int) statement_text.size(), - &statement, - nullptr) != SQLITE_OK) { - throw SQLiteException( - sqlite3_errcode(connection_.get()), - sqlite3_errmsg(connection_.get()), - statement_text); - } - return std::shared_ptr(statement, delete_statement); - } - - void exec(const std::string& statement_text) - { - int return_code = sqlite3_exec( - connection_.get(), - statement_text.c_str(), - nullptr, - nullptr, - nullptr); - if (return_code != SQLITE_OK) { - throw SQLiteException( - return_code, - sqlite3_errmsg(connection_.get()), - statement_text); - } - } - - const std::string last_err_msg() const - { - return sqlite3_errmsg(connection_.get()); - } - - RowIterator begin( - const std::shared_ptr& statement, - bool auto_step = true, - bool ephemerous = true) - { - return RowIterator(statement, *this, auto_step, ephemerous); - } - - RowIterator begin( - const std::string& statement_text, - bool auto_step = true, - bool ephemerous = true) - { - return RowIterator(statement_text, *this, auto_step, ephemerous); - } - - const std::string& sqlite_init_string() { return sqlite_init_string_; } - - /** - * See: https://www.sqlite.org/c3ref/busy_handler.html - * The SQLite busy handler allows for a process to wait when another process - * has a database table locked. This will help concurrency, but also, is - * necessary for some of our automated tests. - */ - static int busy_handler(void *, int) - { - const int32_t max_time_millis = 300; - const auto timeout = std::chrono::milliseconds( - RTIOsapiUtility_randRange(0, max_time_millis)); - - const std::string timeout_str = - std::to_string(timeout.count()) + " milliseconds"; - DDSLogger_log( - RTI_LOG_BIT_CONTENT, - &RTI_LOG_EMPTY_TEMPLATE, - NULL, - "Executing SQLite busy handler: waiting for %s", - timeout_str.c_str()); - - std::this_thread::sleep_for(timeout); - return RTI_TRUE; - } - - static constexpr const char * const default_init_string { - "PRAGMA SYNCHRONOUS = OFF; PRAGMA JOURNAL_MODE = MEMORY;" - }; - - bool table_exists(const std::string& table_name) - { - try { - std::stringstream select_stmt_stream; - select_stmt_stream - << "SELECT * FROM [" << table_name << "] LIMIT 1"; - exec(select_stmt_stream.str()); - } catch (...) { - return false; - } - return true; - } - - int64_t last_rowid() const - { - return sqlite3_last_insert_rowid(connection_.get()); - } - -private: - std::unique_ptr connection_; - bool connected_; - std::vector disconnect_listeners_; - std::string sqlite_init_string_; -}; - -/** - * This class is supposed to be sub-classed by classes that contain an - * SQLite connection, for example, our metadata or discovery file - * abstractions. - */ -class AbstractSQLiteObject { -public: - AbstractSQLiteObject( - const std::string& sqlite_init_string = - SQLiteConnection::default_init_string) - : connection_(sqlite_init_string) - { } - - virtual ~AbstractSQLiteObject() - { } - - virtual SQLiteConnection& connection() { return connection_; } - -protected: - - SQLiteConnection connection_; -}; - - -} } /* rti::app_utils */ - -#endif /* HPP_RTI_APPUTILS_SQLiteConnection_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/ServiceException.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/ServiceException.hpp deleted file mode 100644 index e16974443..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/ServiceException.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * $Id$ - * - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_SERVICE_EXCEPTION_HPP_ -#define HPP_SERVICE_SERVICE_EXCEPTION_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include - -namespace rti { namespace apputils { - -static -void initialize_exception_message( - std::string& message, - const char *throwing_context, - const RTILogMessage *log_message, - va_list ap) -{ - char message_buffer[RTI_LOG_MSG_SIZE_MAX]; - - RTIOsapiUtility_unusedReturnValue( - RTIOsapiUtility_vsnprintf( - message_buffer, - RTI_LOG_MSG_SIZE_MAX, - log_message->format, - ap), - int); - RTIOsapiUtility_unusedReturnValue( - RTIOsapiUtility_snprintf( - &message[0], - RTI_LOG_MSG_SIZE_MAX, - "%s:%s", - throwing_context, - message_buffer), - int); -} - -static -void initialize_exception_message( - std::string& message, - const char *throwing_context, - const RTILogMessageTemplate *log_message, - const char *parameterizedString, - va_list ap) -{ - char message_buffer[RTI_LOG_MSG_SIZE_MAX]; - const char *SEPARATOR_STR = " | "; - - RTIOsapiUtility_unusedReturnValue( - RTIOsapiUtility_vsnprintf( - message_buffer, - RTI_LOG_MSG_SIZE_MAX, - parameterizedString, - ap), - int); - RTIOsapiUtility_unusedReturnValue( - RTIOsapiUtility_snprintf( - &message[0], - RTI_LOG_MSG_SIZE_MAX, - "%s%s%s:%s", - throwing_context, - log_message->format, - strlen(log_message->format) > 0 ? SEPARATOR_STR : "", - message_buffer), - int); -} - -/** - * @brief Exception class for Services - */ -class ServiceException : public std::exception { -public: - - ServiceException( - const char *throwing_context, - const RTILogMessage *log_message, - ...) - : message_(RTI_LOG_MSG_SIZE_MAX, '\0'), - message_id_(log_message->messageId) - { - va_list ap; - va_start(ap, log_message); - initialize_exception_message( - message_, - throwing_context, - log_message, - ap); - va_end(ap); - } - - ServiceException( - const char *throwing_context, - const RTILogMessageTemplate *log_message, - const char *parameterizedString, - ...) - : message_(RTI_LOG_MSG_SIZE_MAX, '\0'), - message_id_(log_message->messageId) - { - va_list ap; - va_start(ap, parameterizedString); - initialize_exception_message( - message_, - throwing_context, - log_message, - parameterizedString, - ap); - va_end(ap); - } - - uint32_t message_id() const - { - return message_id_; - } - - virtual const char* what() const throw () - { - return message_.c_str(); - } - - virtual ~ServiceException() throw () - { - } - -private: - - ServiceException() : message_id_(0u) - { - } - - std::string message_; - std::uint32_t message_id_; -}; - -/** - * @brief Fatal exception class for Services. This exception will cause - * the underlying service to call the shutdown hook. - */ -class FatalServiceException : public ServiceException { -public: - template - FatalServiceException( - const char *throwing_context, - const RTILogMessage *log_message, - Args... args) - : ServiceException(throwing_context, log_message, args...) - { } - - template - FatalServiceException( - const char *throwing_context, - const RTILogMessageTemplate *log_message, - const char *parameterizedString, - Args... args) - : ServiceException( - throwing_context, - log_message, - parameterizedString, - args...) - { } - - virtual ~FatalServiceException() throw() - { } -}; - -} } /* namespace rti::apputils */ - -#define RTI_THROW_SERVICE_EXCEPTION(...) \ - throw rti::apputils::ServiceException(\ - RTI_FUNCTION_NAME,\ - __VA_ARGS__) - -#define RTI_THROW_FATAL_SERVICE_EXCEPTION(...) \ - throw rti::apputils::FatalServiceException(\ - RTI_FUNCTION_NAME,\ - __VA_ARGS__) - -#define RTI_SERVICE_CHECK_CONDITION(EXPRESSION) \ - if(!(EXPRESSION)) { \ - RTI_THROW_SERVICE_EXCEPTION( \ - &RTI_LOG_ANY_s, \ - __FILE__ ":" RTI_TOSTRING(__LINE__) ": condition failed: " #EXPRESSION); \ - } - -#define RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO(EXPRESSION, EXTRA_INFO) \ - if(!(EXPRESSION)) { \ - RTI_THROW_SERVICE_EXCEPTION( \ - &RTI_LOG_ANY_ss, \ - __FILE__ ":" RTI_TOSTRING(__LINE__) ": condition failed: " #EXPRESSION ", ", \ - EXTRA_INFO); \ - } - - -#endif /* HPP_SERVICE_SERVICE_EXCEPTION_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/StringBuffer.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/StringBuffer.hpp deleted file mode 100644 index 44be6bc66..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/StringBuffer.hpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef STRING_BUFFER_HPP -#define STRING_BUFFER_HPP - -#include "rti/apputils/ServiceException.hpp" - -namespace rti { namespace apputils { - -// Default value of a StringBuffer -constexpr size_t STRING_BUFFER_LENGTH = 1000; - -/** - * A GenericStringBuffer is a smart buffer that allocates an INITIAL_CAPACITY - * in the stack and allocates more capacity in the heap if needed. The template - * parameter INITIAL_CAPACITY determines the capacity that is allocated in the - * stack. In case there is a resize which involves heap allocation, the - * destructor of the GenericStringBuffer class frees the memory. - */ -template -class GenericStringBuffer { -public: - /** - * This constructor creates a new empty GenericStringBuffer with - * INITIAL_CAPACITY. - */ - GenericStringBuffer() : capacity_(INITIAL_CAPACITY), c_str_ptr_(nullptr) - { - RTIOsapiMemory_zero(c_str_, capacity_); - c_str_ptr_ = c_str_; - } - - /** - * This constructor creates a new GenericStringBuffer ensuring the size - * of the input parameter. It allocates memory in the heap if necessary. - * @param size Size to ensure. - */ - GenericStringBuffer(const size_t size) - : capacity_(INITIAL_CAPACITY), c_str_ptr_(nullptr) - { - RTIOsapiMemory_zero(c_str_, capacity_); - c_str_ptr_ = c_str_; - ensure_capacity(size); - } - - /** - * This constructor creates a new GenericStringBuffer object containing - * an input string. It ensures whatever capacity is necessary for the input - * string. - * @param str std::string that initializes the GenericStringBuffer. - */ - GenericStringBuffer(const std::string& str) - : capacity_(INITIAL_CAPACITY), c_str_ptr_(nullptr) - { - RTIOsapiMemory_zero(c_str_, capacity_); - c_str_ptr_ = c_str_; - - ensure_capacity(str.length() + 1); - RTIOsapiUtility_unusedReturnValue( - RTIOsapiUtility_strcpy(c_str_ptr_, str.length(), str.c_str()), - char *); - } - - /** - * Copy constructor. - * @param other String buffer that we want to copy - */ - GenericStringBuffer(const GenericStringBuffer& other) - : capacity_(INITIAL_CAPACITY), c_str_ptr_(nullptr) - { - RTIOsapiMemory_zero(c_str_, capacity_); - c_str_ptr_ = c_str_; - - ensure_capacity(other.length() + 1); - RTIOsapiUtility_unusedReturnValue( - RTIOsapiUtility_strcpy( - c_str_ptr_, - other.length(), - other.c_str()), - char *); - } - - /** - * Move constructor. - * @param other String buffer that we want to move - */ - GenericStringBuffer(GenericStringBuffer&& other) - : capacity_(INITIAL_CAPACITY), c_str_ptr_(nullptr) - { - *this = std::move(other); - } - - /** - * Destructor of the GenericStringBuffer. It frees whatever memory may - * have been allocated by the ensure_capacity method(). - */ - ~GenericStringBuffer() - { - if (capacity_ > INITIAL_CAPACITY) { - DDS_String_free(c_str_ptr_); - c_str_ptr_ = nullptr; - } - } - - /** - * Copy-assignment operator - * @param other The buffer we want to copy. - * @return Object in which we have copied. - */ - GenericStringBuffer& operator=(const GenericStringBuffer& other) - { - if (this != &other) { - ensure_capacity(other.length() + 1); - RTIOsapiUtility_unusedReturnValue( - RTIOsapiUtility_strcpy( - c_str_ptr_, - other.length(), - other.c_str()), - char *); - } - - return *this; - } - - /** - * Move-assignment operator - * @param other The buffer we want to move. - * @return Object in which we have moved. - */ - GenericStringBuffer& operator=(GenericStringBuffer&& other) - { - if (this != &other) { - if (other.capacity_ <= INITIAL_CAPACITY) { - RTIOsapiMemory_move(c_str_, other.c_str_, INITIAL_CAPACITY); - c_str_ptr_ = c_str_; - } else { - capacity_ = other.capacity_; - c_str_ptr_ = other.c_str_ptr_; - - other.capacity_ = INITIAL_CAPACITY; - other.c_str_ptr_ = nullptr; - } - } - - return *this; - } - - /** - * Returns the number of bytes that can be written in the internal char * - * buffer - * @return Capacity of the internal char * buffer. - */ - size_t capacity() const - { - return capacity_; - } - - /** - * Returns the length of the internal char * buffer. That is the strlen - * of whatever is in there. - * @return Size of the string stored in the internal char * buffer. - */ - size_t length() const - { - return strlen(c_str_ptr_); - } - - /** - * Returns a const pointer to the internal char * buffer. - * @return Const pointer to the internal char * buffer. - */ - const char *c_str() const - { - return c_str_ptr_; - } - - /** - * Returns a pointer to the internal char * buffer - * @return Pointer to the internal char * buffer. - */ - char *c_str_ptr() - { - return c_str_ptr_; - } - - /** - * This method ensures a capacity by either asserting that the - * GenericStringBuffer has enough space to allocate a string, or - * reallocating some space in the heap. If that is the case more space is - * allocated in the heap via DDS_String_alloc(). - * @param capacity Size that needs to be ensured. - */ - void ensure_capacity(const size_t capacity) - { - if (capacity > capacity_) { - // We need to free the string if it was already allocated, this - // happens when _capacity > INITIAL_CAPACITY - if (capacity_ > INITIAL_CAPACITY) { - DDS_String_free(c_str_ptr_); - } - - // DDS_String_alloc adds one to the input parameter. We could - // spare a byte, but we want to be precise. - c_str_ptr_ = DDS_String_alloc(capacity - 1); - if (c_str_ptr_ == nullptr) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "Error allocating string."); - } - RTIOsapiMemory_zero(c_str_ptr_, capacity_); - capacity_ = capacity; - } - } - -private: - size_t capacity_; - char *c_str_ptr_; - char c_str_[INITIAL_CAPACITY]; -}; - -/** - * A StringBuffer is a GenericStringBuffer with an initial STRING_BUFFER_LENGTH. - */ -typedef GenericStringBuffer StringBuffer; - -/** - * This method saves a "freeform string" into a StringBuffer object. - * @param [in,out] string_buffer StringBuffer in which the input string will - * be saved. Note that if there's not enough capacity, the method will - * automatically allocate more space for the string. - * @param format Format of the string to be saved. - * @param ... Parameters to the formatted string. - */ -inline void StringBuffer_save_freeform( - StringBuffer& string_buffer, - const char *format, - ...) -{ - char *c_str_ptr = string_buffer.c_str_ptr(); - size_t capacity = string_buffer.capacity(); - - va_list args, args_aux; - - RTIXMLSaveContext save_ctxt = RTIXMLSaveContext_INITIALIZER; - - RTIXMLSaveContext_initialize(&save_ctxt); - save_ctxt.sout = c_str_ptr; - - if (!RTIOsapiUtility_sizeToUInt32(save_ctxt.ssize, capacity)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "Error allocating string."); - } - - // Wrap RTIXMLSaveContext_freeform_w_argsI call with va_start and va_end - // of the va_list that we need to pass in. - va_start(args, format); - va_start(args_aux, format); - RTIXMLSaveContext_freeform_v(&save_ctxt, format, args, args_aux); - va_end(args); - va_end(args_aux); - - if (save_ctxt.outputStringLength + 1 > capacity) { - capacity = save_ctxt.outputStringLength + 1; - string_buffer.ensure_capacity(capacity); - - RTIXMLSaveContext_initialize(&save_ctxt); - save_ctxt.sout = string_buffer.c_str_ptr(); - - if (!RTIOsapiUtility_sizeToUInt32(save_ctxt.ssize, capacity)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "Error allocating string."); - } - - // Wrap RTIXMLSaveContext_freeform_w_argsI call with va_start and - // va_end of the va_list that we need to pass in. - va_start(args, format); - va_start(args_aux, format); - RTIXMLSaveContext_freeform_v(&save_ctxt, format, args, args_aux); - va_end(args); - va_end(args_aux); - } -} -}} // namespace rti::apputils - -#endif // STRING_BUFFER_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Connection.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Connection.hpp deleted file mode 100644 index 86f1adf7f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Connection.hpp +++ /dev/null @@ -1,355 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_CLIENT_CONNECTION_HPP -#define HTTP_CLIENT_CONNECTION_HPP - -#include -#include -#include -#include -#include - -#include - -#include "rti/apputils/ServiceException.hpp" -#include "rti/apputils/http/common/Response.hpp" -#include "rti/apputils/http/common/HttpUtils.hpp" -#include "rti/apputils/http/log/Log.hpp" - -#include "Request.hpp" - -namespace rti { namespace apputils { namespace http { namespace client { - -/** - * @brief This class is a wrapper around the SSL configuration for the client. - * - */ -struct SslConfig { - SslConfig( - bool the_enabled = false, - std::string the_client_cert = "", - std::string the_server_cert = "") - : enabled(the_enabled), - client_cert(the_client_cert), - server_cert(the_server_cert) - { } - - bool enabled; - std::string client_cert; - std::string server_cert; -}; - -/** - * @brief This class deal with actual HTTP client requests and - * responses to and from CivetWeb. - */ -class Connection { -public: - /** - * @brief Construct a new Connection object Note that since every request - * reconnects the connection, we do not need to connect in the constructor - * itself. - * - * @param host Hostname of the server - * @param port Port of the server - * @param ssl_config SSL configuration for the client - */ - Connection( - const std::string& host = std::string("localhost"), - std::uint16_t port = HTTP_SERVER_DEFAULT_PORT, - SslConfig ssl_config = SslConfig()) - : host_ { host }, port_ { port }, ssl_config_ { ssl_config } - { } - - /** - * @brief send an actual HTTP request to CivetWeb. It extracts all - * the information from the request and constructs a valid HTTP request - * string. - * - * @param request HTTP request to be sent to the server. - */ - void send_http_request(const Request& request) - { - connect(); - - // Send HTTP method and URL - auto mg_result = mg_printf( - connection_.get(), - "%s %s", - method_to_string(request.http_method()).c_str(), - request.uri()); - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - - // Add URL params to URL - if (request.uri_parameters().size() > 0) { - mg_result = mg_printf(connection_.get(), "?"); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - for (const auto& uri_param : request.uri_parameters()) { - std::array uri_param_value; - uri_param_value.fill('\0'); - // We need to encode the URI params in case they contain - // spaces or any other character that may not be valid in a - // URL - mg_result = mg_url_encode( - uri_param.second.c_str(), - uri_param_value.data(), - MAX_URI_LENGTH); - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_url_encode); - - mg_result = mg_printf( - connection_.get(), - "%s=%s&", - uri_param.first.c_str(), - uri_param_value.data()); - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - } - } - - // Specify HTTP version - mg_result = mg_printf(connection_.get(), " HTTP/%s\r\n", HTTP_VERSION); - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - - // Add user-defined headers - for (const auto& header : request.headers()) { - mg_result = mg_printf( - connection_.get(), - "%s: %s\r\n", - header.first.c_str(), - header.second.c_str()); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - } - - // Add default headers if not defined - if (request.header("Content-Length") == nullptr) { - mg_result = mg_printf( - connection_.get(), - "Content-Length: %llu\r\n", - static_cast(request.body().length())); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - } - - if (request.header("Content-Type") == nullptr) { - mg_result = mg_printf( - connection_.get(), - "Content-Type: %s\r\n", - HTTP_PLAIN_TEXT_CONTENT_TYPE); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - } - - if (request.header("Cache-Control") == nullptr) { - mg_result = mg_printf( - connection_.get(), - "Cache-Control: %s\r\n", - HTTP_CACHE_CONTROL_NO_CACHE); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - } - - if (request.header("Date") == nullptr) { - mg_result = mg_printf( - connection_.get(), - "Date: %s\r\n", - HttpSettings::get_current_date().c_str()); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - } - - // Separate headers from body - mg_result = mg_printf(connection_.get(), "\r\n"); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result > 0, - msg_client_error_printf); - - // Send body of the HTTP request -- if empty it will not write anything - mg_result = mg_printf(connection_.get(), "%s", request.body().c_str()); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result >= 0, - msg_client_error_printf); - } - - /** - * @brief returns a Response based on the actual HTTP response received from - * CivetWeb. It extracts all the information originally stored in the - * mg_connection and transforms it into a valid Response object. - * - * @param timeout Number of milliseconds to wait for a response. A negative - * value means wait indefinitely. - * - * @return Response object with the response from CivetWeb. - */ - Response get_http_response(int timeout = HTTP_CLIENT_TIMEOUT_MS) - { - std::array error_buffer; - error_buffer[0] = '\0'; - - // Get CivetWeb's response. - const auto result = mg_get_response( - connection_.get(), - error_buffer.data(), - error_buffer.size(), - timeout); - - // If we timeout trying to get the response, throw an exception. - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - result >= 0, - error_buffer.data()); - - // Convert CivetWeb's response into a Response - const mg_response_info *response_info = - mg_get_response_info(connection_.get()); - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - response_info != nullptr, - msg_client_error_get_response_info); - - return Response { - static_cast(response_info->status_code), - response_info->status_text, - [&] { - const auto header = - mg_get_header(connection_.get(), "Content-Type"); - return (header == nullptr) ? "" : header; - }(), - this->read_content(), - [&] { - std::unordered_map headers; - for (int i = 0; i < response_info->num_headers; ++i) { - headers.emplace( - response_info->http_headers[i].name, - response_info->http_headers[i].value); - } - return headers; - }() - }; - } - - std::string read_content(std::size_t chunk_size = 256) - { - const auto response_info = mg_get_response_info(connection_.get()); - if (response_info == nullptr) { - RTI_THROW_HTTP_EXCEPTION( - StatusCode::internal_server_error, - &RTI_LOG_ANY_FAILURE_s, - "Error reading content"); - } - - if (response_info->content_length >= 0) { - return read_content_with_content_length( - connection_.get(), - static_cast(response_info->content_length)); - } - - return read_content_without_content_length( - connection_.get(), - chunk_size); - } - -private: - /** - * @brief time we connect, we reset the mg_connection. This ensures - * that CivetWeb's internal buffers and state is cleaned up. This makes - * the Connection easier to use, since it does not need - * to be reconnected with every unit test run. - */ - void connect() - { - std::array error_buffer; - error_buffer[0] = 0; - - if (ssl_config_.enabled) { - mg_client_options client_options = create_client_options(); - connection_.reset(mg_connect_client_secure( - &client_options, - error_buffer.data(), - HTTP_BODY_INITIAL_LENGTH)); - } else { - connection_.reset(mg_connect_client( - host_.c_str(), - port_, - ssl_config_.enabled, - error_buffer.data(), - HTTP_BODY_INITIAL_LENGTH)); - } - - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - connection_ != nullptr || error_buffer[0] == 0, - error_buffer.data()); - } - - /** - * @brief This method closes any existing connection. - */ - struct Disconnect { - void operator()(mg_connection *connection) const - { - mg_close_connection(connection); - } - }; - - /** - * @brief This method create a new mg_client_options object with the - * information provided by the user. - */ - mg_client_options create_client_options() - { - mg_client_options client_options; - - client_options.host = host_.c_str(); - client_options.port = port_; - client_options.client_cert = - (ssl_config_.client_cert.empty() || !ssl_config_.enabled) - ? nullptr - : ssl_config_.client_cert.c_str(); - - client_options.server_cert = - (ssl_config_.server_cert.empty() || !ssl_config_.enabled) - ? nullptr - : ssl_config_.server_cert.c_str(); - - client_options.host_name = - !ssl_config_.enabled ? nullptr : client_options.host; - - return client_options; - } - -private: - std::unique_ptr connection_; - std::string host_; - std::uint16_t port_; - SslConfig ssl_config_; -}; - -}}}} // namespace rti::apputils::http::client - -#endif // HTTP_CLIENT_CONNECTION_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Request.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Request.hpp deleted file mode 100644 index 5887c1dc3..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/Request.hpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_CLIENT_REQUEST_HPP -#define HTTP_CLIENT_REQUEST_HPP - -#include -#include -#include -#include - -#include "rti/apputils/http/common/Method.hpp" -#include "rti/apputils/http/common/HttpUtils.hpp" - -namespace rti { namespace apputils { namespace http { namespace client { - -/** - * @brief Request class allow users to define their own requests in order to - * send them to the server trough the Connection class. - */ -class Request { -public: - /** - * @brief Construct a new Request empty object - */ - Request() - { - uri_.fill('\0'); - } - - /** - * @brief Getter for the HTTP method. - * - * @return Method object associated to the request. - */ - Method http_method() const - { - return http_method_; - } - - /** - * @brief Setter for the HTTP method. - * - * @param http_method HTTP method (POST, PUT, GET, DELETE, HEAD, PATCH, - * OPTIONS). - * @return Reference to the Request object. - */ - Request& http_method(Method http_method) - { - http_method_ = http_method; - return *this; - } - - /** - * @brief Gets the URL of the HTTP request. - * - * @return URL of the HTTP request. - */ - const char *uri() const - { - return uri_.data(); - } - - /** - * @brief Sets the URL of the HTTP request. - * - * @param uri URL of the HTTP request. - * @return Reference to the Request object. - */ - Request& uri(const char *uri) - { - std::copy(uri, uri + std::strlen(uri), uri_.data()); - return *this; - } - - /** - * @brief Sets the URL of the HTTP request. - * - * @param uri URL of the HTTP request. - * @return Reference to the Request object. - */ - Request& uri(const std::string& uri) - { - return this->uri(uri.c_str()); - } - - /** - * @brief Gets the value of an uri parameter. - * - * @param name Name of the parameter. - * @return const std::string* - */ - const std::string *uri_parameter(const std::string& name) const - { - const auto it = uri_parameters_.find(name); - if (it == uri_parameters_.end()) { - return nullptr; - } - - return &it->second; - } - - /** - * @brief Gets all the uri parameters. - * - * @return const StringMap& - */ - const StringMap& uri_parameters() const - { - return uri_parameters_; - } - - /** - * @brief Sets all the uri parameters. - * - * @param uri_parameters StringMap with all the uri parameters. - * @return Request& - */ - Request& uri_parameters(const StringMap& uri_parameters) - { - uri_parameters_ = uri_parameters; - return *this; - } - - /** - * @brief Gets the value of a header.\ - * - * @param name Name of the parameter. - * @return const std::string* - */ - const std::string *header(const std::string& name) const - { - const auto it = headers_.find(name); - if (it == headers_.end()) { - return nullptr; - } - - return &it->second; - } - - /** - * @brief Gets all the headers. - * - * @return const StringMap& - */ - const StringMap& headers() const - { - return headers_; - } - - /** - * @brief Sets all the headers. - * - * @param headers StringMap with all the headers. - * @return Request& - */ - Request& headers(const StringMap& headers) - { - headers_ = headers; - return *this; - } - - /** - * @brief Gets the body of the request. - * - * @return const std::string& - */ - const std::string& body() const - { - return body_; - } - - /** - * @brief Sets the body of the request. - * - * @param body Body of the request. - * @return Request& - */ - Request& body(const std::string& body) - { - body_ = body; - return *this; - } - -private: - Method http_method_ = Method::http_get; - std::array uri_; - StringMap uri_parameters_; - StringMap headers_; - std::string body_; -}; - -}}}} // namespace rti::apputils::http::client - -#endif // HTTP_CLIENT_REQUEST_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/test/CivetWebSocketConnectionTester.h b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/test/CivetWebSocketConnectionTester.h deleted file mode 100644 index ed78d40cc..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/client/test/CivetWebSocketConnectionTester.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2020. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef CIVETWEBSOCKET_TEST_CONNECTION_CLIENT_H -#define CIVETWEBSOCKET_TEST_CONNECTION_CLIENT_H - -#include -#include -#include "civetweb.h" -#include -#include -#include -#include "log/LogMsg.hpp" - -// #include "utils/WebDDSUtils.h" - -#define CIVETWEB_CLIENT_TIMEOUT_MS 1000 -#define WEBSOCKET_ERROR_BUFFER_SIZE 10000 -#define WEBSOCKETinput_buffer__SIZE 10000 -#define WEBSERVER_DEFAULT_PORT 19020 - -namespace rti { namespace apputils { namespace http { namespace client { -namespace test { - -class CivetWebSocketClient { -public: - ~CivetWebSocketClient() - { - mg_close_connection(conn_); - } - - static int websocket_client_data_handler( - struct mg_connection * /*conn*/, - int flags, - char *data, - size_t data_len, - void *user_data) - { - CivetWebSocketClient *user = NULL; - - if (user_data == NULL) { - SERVICELog_exception( - &RTI_LOG_ANY_FAILURE_s, - "No user data defined"); - return 1; - } - - switch (((unsigned) flags & 0xFu)) { - case MG_WEBSOCKET_OPCODE_TEXT: - user = reinterpret_cast(user_data); - user->receive(std::string(data, data_len)); - break; - default: - SERVICELog_exception( - &RTI_LOG_ANY_FAILURE_s, - "The websocket message code received is not recognize"); - break; - } - - return 1; - } - - static void websocket_client_close_handler( - const struct mg_connection *conn, - void *user_data) - { - struct mg_context *context = mg_get_context(conn); - - if (user_data == NULL) { - SERVICELog_exception( - &RTI_LOG_ANY_FAILURE_s, - "No user data defined"); - return; - } - - mg_lock_context(context); - - mg_set_user_connection_data((struct mg_connection *) conn, NULL); - - mg_unlock_context(context); - } - - static std::shared_ptr connect( - const char *host = "localhost", - int port = WEBSERVER_DEFAULT_PORT, - bool use_ssl = false, - const char *path = "/dds/websocket/test") - { - StringBuffer error_buffer(WEBSOCKET_ERROR_BUFFER_SIZE); - auto result = std::make_shared(); - - struct mg_connection *conn = mg_connect_websocket_client( - host, - port, - use_ssl, - (char *) error_buffer.c_str_ptr(), - WEBSOCKET_ERROR_BUFFER_SIZE, - path, - NULL, - websocket_client_data_handler, - websocket_client_close_handler, - result.get()); - - if (conn == NULL) { - SERVICELog_exception(&RTI_LOG_ANY_FAILURE_s, "No Connection"); - result.reset(); - return result; - } - - result->connection(conn); - return result; - } - -public: - CivetWebSocketClient() = default; - - CivetWebSocketClient(mg_connection *conn) - : conn_(conn) - { } - - void send(const StringBuffer& msg) - { - mg_websocket_client_write( - conn_, - MG_WEBSOCKET_OPCODE_TEXT, - msg.c_str(), - msg.length()); - } - - void request_close() - { - mg_websocket_client_write( - conn_, - MG_WEBSOCKET_OPCODE_CONNECTION_CLOSE, - NULL, - 0); - } - - void receive(const StringBuffer& buffer) - { - std::lock_guard guard(mutex_); - received_buffer_.push(buffer); - } - - bool buffer(StringBuffer& buffer) - { - std::lock_guard guard(mutex_); - bool received = false; - if (!received_buffer_.empty()) { - buffer = received_buffer_.front(); - received_buffer_.pop(); - received = true; - } - return received; - } - - void connection(mg_connection *conn) - { - conn_ = conn; - } - -private: - mg_connection *conn_ = nullptr; - std::queue received_buffer_; - std::recursive_mutex mutex_; -}; - -}}}}} // namespace rti::apputils::http::client::test - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpException.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpException.hpp deleted file mode 100644 index dc964bb89..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpException.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_EXCEPTION_HPP -#define HTTP_EXCEPTION_HPP - -// RTI headers -#include "rti/apputils/http/common/StatusCode.hpp" -#include "rti/apputils/ServiceException.hpp" - -namespace rti { namespace apputils { namespace http { - -/** - * @brief Exception class for HTTP errors that inherit from ServiceException - */ -class HttpException : public ServiceException { -public: - /** - * @brief Constructor - * - * @param throwing_context The context where the exception was thrown - * @param status_code HTTP status code - * @param log_message RTILog message (it could be a format string) - */ - template - HttpException( - const char *throwing_context, - StatusCode error_code, - const RTILogMessage *log_message, - Args... args) - : ServiceException(throwing_context, log_message, args...), - error_code_(error_code) - { } - - /** - * @brief Constructor - * - * @param ServiceException Service Exception to build the HttpException - * @param status_code HTTP status code - */ - HttpException( - const ServiceException& e, - StatusCode error_code) - : ServiceException(e), - error_code_(error_code) - { } - - /** - * @brief Get the HTTP status code - * - * @return HTTP status code - */ - StatusCode error_code() const - { - return error_code_; - } - -private: - StatusCode error_code_; -}; - -}}} // namespace rti::apputils::http - -#define RTI_THROW_HTTP_EXCEPTION(...) \ - throw rti::apputils::http::HttpException(RTI_FUNCTION_NAME, __VA_ARGS__) - -#endif // HTTP_EXCEPTION_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpUtils.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpUtils.hpp deleted file mode 100644 index d0364e0fc..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/HttpUtils.hpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_UTILS_H -#define HTTP_UTILS_H - -#include -#include -#include - -#include - -#include -#include - -#include "HttpException.hpp" -#include "StatusCode.hpp" - -namespace rti { namespace apputils { namespace http { - -using StringMap = std::unordered_map; - -// Unfortunately Civetweb doesn't expose these constants, so we needed to -// copy the values from civetweb.c (static struct mg_option config_options[]) -constexpr auto HTTP_CLIENT_TIMEOUT_MS = int { 1000 }; -constexpr auto HTTP_SERVER_DEFAULT_PORT = int { 8080 }; -constexpr auto HTTP_SERVER_DEFAULT_PORT_STR = "8080"; -constexpr auto HTTP_SERVER_DEFAULT_HOST = "127.0.0.1"; -constexpr auto HTTP_VERSION = "1.1"; -constexpr auto HTTP_CACHE_CONTROL_NO_CACHE = "no-cache"; -constexpr auto HTTP_BODY_INITIAL_LENGTH = std::size_t { 1000 }; -constexpr auto HTTP_PLAIN_TEXT_CONTENT_TYPE = "text/plain"; -constexpr auto HTTP_JSON_CONTENT_TYPE = "application/json"; -constexpr auto HTTP_XML_CONTENT_TYPE = "application/xml"; -constexpr auto HTTP_CONTENT_TYPE_HEADER = "Content-Type"; -constexpr auto HTTP_DATE_STR_LENGTH = std::size_t { 64 }; - -/** - * Maximum URL length we handle is 2048. This value is based on the - * comments on this article http://stackoverflow.com/questions/417142 - */ -constexpr auto MAX_URI_LENGTH = int { 2048 }; - -/** - * @brief This structure contains utility methods to generate HttpSettings that - * need to be set as part of the HTTP response. - */ -struct HttpSettings { - /** - * @brief This method converts time_t to a string. According to RFC2616, - * Sec 14.18, this must be included in all responses other than - * 100, 101, 5xx. - * - * @return A string containing the date in the format specified by RFC2616. - */ - static std::string get_current_date() - { - const auto curtime = std::time(nullptr); - if (curtime == (time_t) -1) { - return "Thu, 01 Jan 1970 00:00:00 GMT"; - } - - struct tm curr_tm; -#ifdef RTI_WIN32 - if (gmtime_s(&curr_tm, &curtime) != 0) { - return "Thu, 01 Jan 1970 00:00:00 GMT"; - } -#else - if (gmtime_r(&curtime, &curr_tm) != &curr_tm) { - return "Thu, 01 Jan 1970 00:00:00 GMT"; - } -#endif - - auto result = std::string(HTTP_DATE_STR_LENGTH, '\0'); - const auto bytes_written = std::strftime( - &result[0], - result.size(), - "%a, %d %b %Y %H:%M:%S GMT", - &curr_tm); - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - bytes_written > 0, - "Error in std::strftime"); - - result.resize(bytes_written); - return result; - } -}; - -inline std::string read_content_with_content_length( - mg_connection *connection, - std::size_t content_length) -{ - auto content = std::string(content_length, 0); - - auto result = 0; - while (content_length > 0 && result >= 0) { - result = mg_read(connection, - &content[content.size() - content_length], - content_length); - - content_length -= result; - } - - return content; -} - -inline std::string read_content_without_content_length( - mg_connection *connection, - std::size_t chunk_size = 256) -{ - auto content = std::string(); - auto bytes_read = std::size_t { 0 }; - auto result = 0; - - do { - bytes_read += result; - content.resize(bytes_read + chunk_size); - result = mg_read(connection, &content[bytes_read], chunk_size); - } while (result > 0); - - content.resize(bytes_read); - return content; -} - -inline std::string base64_encode(const std::string& in) -{ - std::string out; - out.reserve(in.size() * 2); - - const char *b64 = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - for (std::size_t i = 0; i < in.size(); i += 3) { - // Static cast to unsigned char to avoid cert_str34_c_violation - int a = static_cast(in[i]); - int b = i + 1 >= in.size() ? 0 : static_cast(in[i + 1]); - int c = i + 2 >= in.size() ? 0 : static_cast(in[i + 2]); - - out.push_back(b64[a >> 2]); - out.push_back(b64[((a & 3) << 4) | (b >> 4)]); - if (i + 1 < in.size()) { - out.push_back(b64[(b & 15) << 2 | (c >> 6)]); - } - if (i + 2 < in.size()) { - out.push_back(b64[c & 63]); - } - } - - while (out.size() % 4 != 0) { - out.push_back('='); - } - - out.shrink_to_fit(); - return out; -} - -}}} // namespace rti::apputils::http - -#endif // HTTP_UTILS_H diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Method.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Method.hpp deleted file mode 100644 index 5ed2de89b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Method.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_METHOD_HPP -#define HTTP_METHOD_HPP - -#include - -#include "rti/apputils/http/common/HttpException.hpp" - -namespace rti { -namespace apputils { namespace http { -/** - * Enum class with every HTTP method - */ -enum class Method { - http_post, - http_put, - http_get, - http_delete, - http_options, - http_head, - http_patch -}; - -/** - * @brief Convert a Method enum to an std::string - * - * @param http_method Method enum to convert - * @return std::string with the method name - */ -inline std::string method_to_string(Method http_method) -{ - switch (http_method) { - case Method::http_post: - return "POST"; - case Method::http_put: - return "PUT"; - case Method::http_get: - return "GET"; - case Method::http_delete: - return "DELETE"; - case Method::http_options: - return "OPTIONS"; - case Method::http_head: - return "HEAD"; - case Method::http_patch: - return "PATCH"; - default: - RTI_THROW_HTTP_EXCEPTION( - StatusCode::bad_request, - &RTI_LOG_ANY_FAILURE_s, - "Invalid HTTP method"); - } -} - -/** - * @brief Convert a std::string to a Method enum - * - * @param http_method String to convert - * @return Method enum - */ -inline Method method_from_string(const std::string& http_method) -{ - if (http_method == "POST") { - return Method::http_post; - } else if (http_method == "PUT") { - return Method::http_put; - } else if (http_method == "GET") { - return Method::http_get; - } else if (http_method == "DELETE") { - return Method::http_delete; - } else if (http_method == "OPTIONS") { - return Method::http_options; - } else if (http_method == "HEAD") { - return Method::http_head; - } else if (http_method == "PATCH") { - return Method::http_patch; - } else { - RTI_THROW_HTTP_EXCEPTION( - StatusCode::bad_request, - &RTI_LOG_ANY_FAILURE_s, - "Invalid HTTP method"); - } -} - -}}} // namespace rti::apputils::http - -#endif // HTTP_METHOD_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Response.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Response.hpp deleted file mode 100644 index f91751f82..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/Response.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_RESPONSE_HPP -#define HTTP_RESPONSE_HPP - -#include -#include - -namespace rti { namespace apputils { namespace http { - -/** - * @brief This class contains all the elements involved in an HTTP response - */ -struct Response { - /** - * Response's status code - */ - unsigned short http_status_code; - - /** - * Response's reason phrase - */ - std::string http_reason_phrase; - - /** - * Response's content type - */ - std::string http_content_type; - - /** - * Response's body - */ - std::string http_content; - - /** - * Response's headers as a map - */ - std::unordered_map http_headers; - -}; -}}} // namespace rti::apputils::http - -#endif // HTTP_RESPONSE_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/StatusCode.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/StatusCode.hpp deleted file mode 100644 index df8aa51c9..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/StatusCode.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_STATUS_CODE_HPP -#define HTTP_STATUS_CODE_HPP - -#include - -namespace rti { namespace apputils { namespace http { - - /** - * @brief Enum class with HTTP status codes. - */ -enum class StatusCode { - ok = 200, - created = 201, - accepted = 202, - no_content = 204, - multiple_choices = 300, - moved_permanently = 301, - moved_temporarily = 302, - not_modified = 304, - bad_request = 400, - unauthorized = 401, - forbidden = 403, - not_found = 404, - not_allowed = 405, - internal_server_error = 500, - not_implemented = 501, - bad_gateway = 502, - service_unavailable = 503 -}; - -/** - * @brief Convert a StatusCode enum to an std::string - * - * @param status_code StatusCode enum to convert - * @return std::string with the status code name - */ -inline std::string status_code_to_string(StatusCode status_code) -{ - switch (status_code) { - case StatusCode::ok: - return "OK"; - case StatusCode::created: - return "Created"; - case StatusCode::accepted: - return "Accepted"; - case StatusCode::no_content: - return "No Content"; - case StatusCode::multiple_choices: - return "Multiple Choices"; - case StatusCode::moved_permanently: - return "Moved Permanently"; - case StatusCode::moved_temporarily: - return "Moved Temporarily"; - case StatusCode::not_modified: - return "Not Modified"; - case StatusCode::bad_request: - return "Bad Request"; - case StatusCode::unauthorized: - return "Unauthorized"; - case StatusCode::forbidden: - return "Forbidden"; - case StatusCode::not_found: - return "Not Found"; - case StatusCode::not_allowed: - return "Not Allowed"; - case StatusCode::internal_server_error: - return "Internal Server Error"; - case StatusCode::not_implemented: - return "Not Implemented"; - case StatusCode::bad_gateway: - return "Bad Gateway"; - case StatusCode::service_unavailable: - return "Service Unavailable"; - default: - return ""; - } -} -}}} // namespace rti::apputils::http - -#endif // HTTP_STATUS_CODE_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/WebSocketUtils.h b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/WebSocketUtils.h deleted file mode 100644 index b34a76095..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/common/WebSocketUtils.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2024. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef WEBSOCKET_API_UTILS_H_ -#define WEBSOCKET_API_UTILS_H_ - -#include "dds_c/dds_c_printformat.h" -#include - -#include - -#define ERR_LOST_HEADER "Lost header" -#define WEBSOCKET_RESPONSE_NAME "response" -#define WEBSOCKET_HELLO_FAIL_HEADER "HELLO FAIL:" - -namespace rti { namespace apputils { namespace websocket { - -enum class WebSocketStateKind{ - UNKNOWN, - CREATE, - OPEN, - READY, - CLOSE -}; - -enum class WebSocketContentType{ - UNKNOWN, - JSON, - XML -}; - -inline DDS_PrintFormatKind to_print_format_kind(WebSocketContentType contentType) { - return contentType == WebSocketContentType::JSON - ? DDS_JSON_PRINT_FORMAT - : DDS_XML_PRINT_FORMAT; -} - -inline WebSocketContentType to_websocket_content_type(DDS_PrintFormatKind formatKind) { - WebSocketContentType value = WebSocketContentType::UNKNOWN; - switch (formatKind) { - case DDS_JSON_PRINT_FORMAT: - value = WebSocketContentType::JSON; - break; - case DDS_XML_PRINT_FORMAT: - value = WebSocketContentType::XML; - break; - case DDS_DEFAULT_PRINT_FORMAT: - value = WebSocketContentType::XML; - break; - default: - value = WebSocketContentType::UNKNOWN; - break; - } - return value; -} - -/** - * The RequestException class defines a exception will log an error message - * via RTIWsddsLog_exeption or will just propagate a given return code - * identifying the error and an error message. The class inherits from - * Exception, as a result users can use familiar interfaces, such as what() to - * get the error message. Also it have the request id to create the error - * message to be sent. - */ -class RequestException : public rti::apputils::http::HttpException { -public: - RequestException( - const char *throwing_context, - rti::apputils::http::StatusCode error_code, - const RTILogMessage *log_message, - const char *method_name, - ...) - : HttpException(throwing_context, error_code, log_message), - method_name_(method_name) - { - } - - /** - * Returns the method name that threw the exception. - * @return Method name that threw the exception. - */ - const char * get_method_name() const - { - return method_name_; - } - -private: - const char *method_name_; -}; - -}}} // namespace rti::webdds::websocket - -#endif // WEBSOCKET_API_UTILS_H_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/log/Log.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/log/Log.hpp deleted file mode 100644 index 3bf9110b6..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/log/Log.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_LOG_HPP -#define HTTP_LOG_HPP - -#include "log/log_common.h" -#include "log.peer.h" -#include "apputils/apputils_log.h" - -#define APPUTILS_CURRENT_SUBMODULE SUBMODULE_APPUTILS_HTTP - -const struct RTILogMessage APPUTILS_LOG_HTTP_EXAMPLE_sss= { - PRODUCT_WAVEWORKS|MODULE_APPUTILS|SUBMODULE_APPUTILS_HTTP|0, - "%s: %s: %s" -}; - -const struct RTILogMessage APPUTILS_LOG_HTTP_SENT_RESPONSE_us= { - PRODUCT_WAVEWORKS|MODULE_APPUTILS|SUBMODULE_APPUTILS_HTTP|1, - "Sent response %u '%s'\n" -}; - -constexpr auto msg_client_error_printf = "Client: error at mg_printf"; -constexpr auto msg_client_error_url_encode = "Client: error at mg_url_encode"; -constexpr auto msg_client_error_get_response_info = - "Client: error at mg_get_response_info"; - -constexpr auto msg_server_error_printf = "Server: error at mg_printf"; -constexpr auto msg_server_error_read = "Server: error at mg_read"; -constexpr auto msg_server_error_send_http_error = "Server: error at mg_send_http_error"; -constexpr auto msg_server_error_get_request_info = "Server: error at mg_get_request_info"; -constexpr auto msg_server_error_get_header = "Server: error at mg_get_header"; - -#endif // HTTP_UTILS_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/CivetWebSocketConnection.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/CivetWebSocketConnection.hpp deleted file mode 100644 index d903fa67e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/CivetWebSocketConnection.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2024. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef CIVETWEBSOCKET_CONNECTION_H -#define CIVETWEBSOCKET_CONNECTION_H - -#include - -#include "WebSocketConnection.hpp" - -namespace rti { namespace apputils { namespace websocket { namespace civetweb { - -class CivetWebSocketConnection : public WebSocketConnection { -public: - explicit CivetWebSocketConnection(struct mg_connection *conn) : conn_(conn) - { - } - - void send(const StringBuffer& msg) - { - struct mg_context *context = mg_get_context(conn_); - - mg_lock_context(context); - - mg_websocket_write( - conn_, - MG_WEBSOCKET_OPCODE_TEXT, - msg.c_str(), - msg.length()); - - mg_unlock_context(context); - } - - void send_pong(const StringBuffer& msg) - { - mg_context *context = mg_get_context(conn_); - - mg_lock_context(context); - - mg_websocket_write( - conn_, - MG_WEBSOCKET_OPCODE_PONG, - msg.c_str(), - msg.length()); - - mg_unlock_context(context); - } - - - bool operator==(WebSocketConnection* conn) - { - return conn_ == static_cast(conn)->conn(); - } - - const struct mg_connection* conn() const - { - return conn_; - } - - void close() - { - struct mg_context *context = mg_get_context(conn_); - - mg_lock_context(context); - - mg_close_connection(conn_); - - mg_unlock_context(context); - } - -private: - mg_connection* conn_; -}; - -}}}} // namespace rti::apputils::websocket::civetweb - -#endif // CIVETWEBSOCKET_CONNECTION_H diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Connection.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Connection.hpp deleted file mode 100644 index 8e0d734aa..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Connection.hpp +++ /dev/null @@ -1,292 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_SERVER_CONNECTION_HPP -#define HTTP_SERVER_CONNECTION_HPP - -#include -#include -#include - -#include "rti/apputils/http/common/HttpUtils.hpp" -#include "rti/apputils/http/common/Response.hpp" -#include "rti/apputils/http/log/Log.hpp" -#include "log.peer.h" - -#include "Request.hpp" - -namespace rti { namespace apputils { namespace http { namespace server { - -/** - * @brief This class implements the interfaces defined by rest::Connection to - * deal with CivetWeb's native connections. - */ -class Connection { -public: - /** - * @brief Constructor of the Connection class. It saves a reference to - * CivetWeb's native connection. It also constructs a Request from - * the connection passed by parameter. - * - * @param conn CivetWeb's connection that is wrapped in this class. - */ - explicit Connection(mg_connection *conn) : conn_(conn), request_(conn_) - { } - - /** - * Destructor of the Connection class. - */ - ~Connection() - { } - - /** - * @brief This method returns the HTTP request. - * - * @return The HTTP Request. - */ - const Request& request() const - { - return request_; - } - - /** - * @brief This method returns the CivetWeb's native connection. - * - * @return The CivetWeb's native connection. - */ - mg_connection *connection() const - { - return conn_; - } - - /** - * @brief This method sends an "Error 501: Not Implemented" response. - */ - void send_not_implemented(std::string const& message = std::string()) - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = - static_cast(StatusCode::not_implemented); - response.http_reason_phrase = - status_code_to_string(StatusCode::not_implemented); - response.http_content = message; - - this->send_http_response(response); - } - - /** - * @brief This method sends an "OK 204: No Content" response. - */ - void send_http_ok_no_content() - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = - static_cast(StatusCode::no_content); - response.http_reason_phrase = - status_code_to_string(StatusCode::no_content); - - this->send_http_response(response); - } - - /** - * @brief This method sends an "Error 400: Bad Request" response. - */ - void send_http_bad_request(std::string const& message = std::string()) - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = - static_cast(StatusCode::bad_request); - response.http_reason_phrase = - status_code_to_string(StatusCode::bad_request); - response.http_content = message; - - this->send_http_response(response); - } - - /** - * @brief This method sends an "Error 404: Not Found" response. - */ - void send_http_not_found(std::string const& message = std::string()) - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = - static_cast(StatusCode::not_found); - response.http_reason_phrase = - status_code_to_string(StatusCode::not_found); - response.http_content = message; - - this->send_http_response(response); - } - - /** - * @brief This method sends an "Error 405: Method Not Allowed" response. - */ - void send_http_method_not_allowed( - std::string const& message = std::string()) - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = - static_cast(StatusCode::not_allowed); - response.http_reason_phrase = - status_code_to_string(StatusCode::not_allowed); - response.http_content = message; - - this->send_http_response(response); - } - - /** - * @brief This method sends an "OK 202: Accepted" response. - */ - void send_http_accepted(std::string const& message = std::string()) - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = - static_cast(StatusCode::accepted); - response.http_reason_phrase = - status_code_to_string(StatusCode::accepted); - response.http_content = message; - - this->send_http_response(response); - } - - /** - * @brief This method sends an "OK 200: OK" response. - */ - void send_http_ok(std::string const& message = std::string()) - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = static_cast(StatusCode::ok); - response.http_reason_phrase = status_code_to_string(StatusCode::ok); - response.http_content = message; - - this->send_http_response(response); - } - - /** - * @brief This operation constructs an HTTP response given its definition in - * Response format. Once the Response is constructed, is sent via CivetWeb's - * native APIs. - */ - void send_http_response(const Response& rpns) - { - // Constructs headers and body of the HTTP response. - auto mg_result = mg_printf( - conn_, - "HTTP/%s %u %s\r\n" - "Content-Type: %s\r\n" - "Cache-Control: %s\r\n" - "Content-Length: %lu\r\n" - "Access-Control-Allow-Origin: *\r\n" - "Date: %s\r\n\r\n" - "%s", - HTTP_VERSION, - rpns.http_status_code, - rpns.http_reason_phrase.c_str(), - rpns.http_content_type.c_str(), - HTTP_CACHE_CONTROL_NO_CACHE, - rpns.http_content.length(), - HttpSettings::get_current_date().c_str(), - rpns.http_content.c_str()); - - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result >= 0, - msg_server_error_printf); - - APPUTILSLogMessage_log( - RTI_LOG_BIT_LOCAL, - &APPUTILS_LOG_HTTP_SENT_RESPONSE_us, - rpns.http_status_code, - rpns.http_reason_phrase.c_str()); - } - - /** - * @brief Prepares and send the body of an HTTP response given an exception. - * - * @param [in] e Exception to be formatted and sent. - */ - void send_error_exception_response(const HttpException& e) - { - auto response = Response(); - - response.http_content_type = HTTP_JSON_CONTENT_TYPE; - response.http_status_code = static_cast(e.error_code()); - response.http_reason_phrase = status_code_to_string(e.error_code()); - - nlohmann::json http_content_json; - http_content_json["code"] = status_code_to_string(e.error_code()); - http_content_json["message"] = e.what(); - response.http_content = http_content_json.dump(); - - this->send_http_response(response); - } - - /** - * @brief Read the content of an HTTP request. - * - * @param chunk_size size of the chunk to read. - * @return std::string with the read content. - */ - std::string read_content(std::size_t chunk_size = 256) - { - const auto request_info = mg_get_request_info(conn_); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - request_info != nullptr, - msg_server_error_get_request_info); - - if (request_info->content_length >= 0) { - return read_content_with_content_length( - conn_, - static_cast(request_info->content_length)); - } - - return read_content_without_content_length(conn_, chunk_size); - } - - /** - * @brief Check that content type is the expected one. - * - * @param expected_content_type - * @return true if the content type is the expected one. otherwise - * false. - */ - bool check_content_type(const std::string& expected_content_type) - { - auto ret = true; - // Check if Content-Type is application/json - if (this->request().get_header( - rti::apputils::http::HTTP_CONTENT_TYPE_HEADER) - != expected_content_type) { - ret = false; - } - return ret; - } - -private: - mg_connection *conn_; - Request request_; -}; - -}}}} // namespace rti::apputils::http::server - -#endif // HTTP_SERVER_CONNECTION_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Request.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Request.hpp deleted file mode 100644 index 2f1adf6f0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Request.hpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_SERVER_REQUEST_HPP -#define HTTP_SERVER_REQUEST_HPP - -#include -#include - -#include -#include - -#include "rti/apputils/StringBuffer.hpp" -#include "rti/apputils/http/common/Method.hpp" -#include "rti/apputils/http/common/HttpException.hpp" - -namespace rti { namespace apputils { namespace http { namespace server { - -/** - * @brief This class implements the Request to handle Requests, that is - * requests provided by the CivetWeb server. - */ -class Request { -public: - /** - * @brief Constructor of the Request. Retrieves information from the - * mg_request_info provided by CivetWeb's connection. - * - * @param conn Civetweb's connection. - */ - explicit Request(mg_connection *conn) : conn_(conn) - { } - - /** - * @brief Destructor of the Request class. - */ - ~Request() - { } - - /** - * @brief Returns the URL of CivetWeb's request. - * - * @return URL of the HTTP request. - */ - const char *uri() const - { - const auto req = mg_get_request_info(conn_); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - req != nullptr, - msg_server_error_get_request_info); - - return req->local_uri; - } - - /** - * @brief Gets a URI parameter given its name. - * - * @param value The value of the parameter. - * @param name of the parameter to be retrieved. - * @return Indicates whether the parameter was found. - */ - bool uri_param(std::string& value, const std::string& name) const - { - const auto req = mg_get_request_info(conn_); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - req != nullptr, - msg_server_error_get_request_info); - if (req->query_string == nullptr) { - return false; - } - return CivetServer::getParam(req->query_string, name.c_str(), value); - } - - /** - * @brief Constructs a map with the query parameters in a given URI. - * - * @param params Map with decoded names and values of all the query - * parameters in the URI. - * @return Boolean value indicating whether query parameters were retrieved - * or not. - */ - bool uri_params(StringMap& params) const - { - const auto req = mg_get_request_info(conn_); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - req != nullptr, - msg_server_error_get_request_info); - - if (req->query_string == nullptr) { - return false; - } - - const auto query_string = req->query_string; - auto query_string_length = strlen(query_string); - auto i = std::size_t { 0 }; - - while (i < query_string_length) { - // Get Name - auto i0 = i; - while ((i < query_string_length) && query_string[i] != '=' - && query_string[i] != '&') { - i++; - } - auto name = std::string(); - CivetServer::urlDecode(&query_string[i0], i - i0, name, true); - if (i < query_string_length && query_string[i] == '=') { - i++; - } - - // Get Value - i0 = i; - while ((i < query_string_length) && query_string[i] != '&') { - i++; - } - - auto value = std::string(); - CivetServer::urlDecode(&query_string[i0], i - i0, value, true); - if (i < query_string_length && query_string[i] == '&') { - i++; - } - - // Add key-value pair to the map - params[name] = value; - } - - return true; - } - - /** - * @brief Gets a URI header given its name. - * - * @param Name of the header to be retrieved. - * @return Gets the value of an HTTP header given its name. - */ - const char *get_header(const char *name) const - { - const char *value = mg_get_header(conn_, name); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - value != nullptr, - msg_server_error_get_header); - - return value; - } - - /** - * @brief This method saves the body of the HTTP request in the body buffer. - * - * @param [out] Body of the HTTP request. - * @param [in,out] Length of the body of the HTTP request. - */ - void get_body(char *& body, size_t& body_length) const - { - auto mg_result = mg_read(conn_, body, body_length); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result >= 0, - msg_server_error_read); - } - - /** - * @brief Saves the body of the HTTP request in a string buffer. - * - * @param [out] Body of the HTTP request in StringBuffer. - */ - void get_body(StringBuffer& body) const - { - const auto body_length = get_body_length(); - body.ensure_capacity(body_length + 1); - - auto mg_result = mg_read(conn_, body.c_str_ptr(), body_length); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - mg_result >= 0, - msg_server_error_read); - } - - /** - * @brief Returns the length of the body of the HTTP request. - * - * @return Body length. - */ - size_t get_body_length() const - { - const auto req = mg_get_request_info(conn_); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - req != nullptr, - msg_server_error_get_request_info); - - auto content_length = req->content_length; - - // Check that the content_length is not negative (except for GET, - // DELETE, and PUT operations) where it is permitted. - if ((content_length < 0) && (strcmp(req->request_method, "GET") != 0) - && (strcmp(req->request_method, "DELETE") != 0) - && (strcmp(req->request_method, "PUT") != 0)) { - RTI_THROW_HTTP_EXCEPTION( - StatusCode::bad_request, - &RTI_LOG_ANY_FAILURE_s, - "Content-length of the HTTP request is invalid."); - } - - return content_length < 0 ? 0 : static_cast(content_length); - } - - /** - * @brief Returns the method of the HTTP request. - * - * @return Method of the HTTP request. - */ - Method get_http_method() const - { - const struct mg_request_info *req = mg_get_request_info(conn_); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - req != nullptr, - msg_server_error_get_request_info); - - return method_from_string( - req->request_method == nullptr ? "" : req->request_method); - } - -private: - struct mg_connection *conn_; -}; - -}}}} // namespace rti::apputils::http::server - -#endif // HTTP_SERVER_REQUEST_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/RequestHandler.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/RequestHandler.hpp deleted file mode 100644 index 5c69e71d3..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/RequestHandler.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_SERVER_REQUEST_HANDLER_HPP -#define HTTP_SERVER_REQUEST_HANDLER_HPP - -#include - - -#include "rti/apputils/http/common/Method.hpp" -#include "rti/apputils/http/common/HttpUtils.hpp" - -#include "Connection.hpp" -#include "ServerProperty.hpp" - -namespace rti { namespace apputils { namespace http { namespace server { - -// Forward declaration -class Server; - -/** - * @brief This class defines a generic interface to be implemented by each - * RequestHandler. This implies implementing a set or methods to handle - * different types of requests (e.g., POST, PUT, GET, DELETE, OPTIONS, HEAD and - * PATCH). - */ -class RequestHandler { -public: - /** - * @brief Virtual destructor of the RequestHandler class. - */ - virtual ~RequestHandler() - { } - - /** - * @brief The POST request handler is an interface to implement a method - * that addresses POST requests and generates responses. - * - * @param server Reference to the wrapper of the internal server API. - * @param connection - * @param web_server_property Reference to the web server properties. - */ - virtual void handle_post( - Server&, - Connection& connection, - const ServerProperty&) - { - connection.send_not_implemented(); - } - - /** - * @brief The PUT request handler is an interface to implement a method that - * addresses PUT requests and generates responses. - * - * @param server Reference to the wrapper of the internal server API. - * @param connection - * @param web_server_property Reference to the service properties. - */ - virtual void handle_put( - Server&, - Connection& connection, - const ServerProperty&) - { - connection.send_not_implemented(); - } - - /** - * @brief The GET request handler is an interface to implement a method that - * addresses GET requests and generates responses. - * - * @param server Reference to the wrapper of the internal server API. - * @param connection - * @param web_server_property Reference to the service properties. - */ - virtual void handle_get( - Server&, - Connection& connection, - const ServerProperty&) - { - connection.send_not_implemented(); - } - - /** - * @brief The DELETE request handler is an interface to implement a method - * that addresses DELETE requests and generates responses. - * - * @param server Reference to the wrapper of the internal server API. - * @param connection - * @param web_server_property Reference to the web server properties. - */ - virtual void handle_delete( - Server&, - Connection& connection, - const ServerProperty&) - { - connection.send_not_implemented(); - } - - /** - * @brief The OPTIONS request handler is an interface to implement a method - * that addresses OPTIONS requests and generates responses. - * - * @param server Reference to the wrapper of the internal server API. - * @param connection - * @param web_server_property Reference to the web server properties. - */ - virtual void handle_options( - Server&, - Connection& connection, - const ServerProperty&) - { - connection.send_not_implemented(); - } - - /** - * @brief The HEAD request handler is an interface to implement a method - * that addresses HEAD requests and generates responses. - * - * @param server Reference to the wrapper of the internal server API. - * @param connection - * @param web_server_property Reference to the web server properties. - */ - virtual void handle_head( - Server&, - Connection& connection, - const ServerProperty&) - { - connection.send_not_implemented(); - } - - /** - * @brief The PATCH request handler is an interface to implement a method - * that addresses PATCH requests and generates responses. - * - * @param server Reference to the wrapper of the internal server API. - * @param connection - * @param web_server_property Reference to the web server properties. - */ - virtual void handle_patch( - Server&, - Connection& connection, - const ServerProperty&) - { - connection.send_not_implemented(); - } -}; - -}}}} // namespace rti::apputils::http::server - -#endif // HTTP_SERVER_REQUEST_HANDLER_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Server.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Server.hpp deleted file mode 100644 index 0d3f7d5d5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/Server.hpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2019. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_SERVER_HPP -#define HTTP_SERVER_HPP - -#include -#include -#include - -#include - -#include "ServerProperty.hpp" -#include "rti/apputils/http/server/detail/CivetWebHandler.hpp" - -namespace rti { namespace apputils { namespace http { namespace server { - -/** - * @brief Server defines an interface to CivetWeb::CivetServer and allow us to - * create handlers and close the server thought it. - */ -class Server { -public: - /** - * @brief Constructor of the Server class. - * - * @param options CivetServer options - * @param callbacks Callbacks methods - */ - Server(const ServerProperty& server_property, - const CivetCallbacks *callbacks = nullptr) - : server_(std::unique_ptr(new CivetServer( - server_property.webserver_options(), - callbacks))), - server_property_(server_property), - handlers_() - { } - - ~Server() - { - close(); - mg_exit_library(); - } - - /** - * @brief This method closes the server, i.e. calls CivetServer::close(). - */ - void close() - { - constexpr auto num_retries = 10u; - for (auto i = 0u; !can_close() && i < num_retries; ++i) { - std::this_thread::sleep_for(std::chrono::seconds(1)); - } - - server_->close(); - } - - /** - * @brief Checks if the server has any callbacks still running so that it - * can be closed. - * - * @return True if the server can be closed. False otherwise. - */ - bool can_close() - { - return std::none_of( - handlers_.begin(), - handlers_.end(), - [](const std::unique_ptr& handler) { - return handler->callbacks_running(); - }); - } - - template - void add_handler(Handler *handler) - { - handlers_.emplace_back(std::unique_ptr( - new CivetWebHandler(server_property_, *this, handler))); - - server_->addHandler(Handler::URI_PATTERN, handlers_.back().get()); - } - - /** - * @brief Adds a URI handler. Existing handlers will be overwritten. - * - * @param uri String with the URI - * @param handler CivetServer pointer to the handler that to be added - */ - template - void add_handler() - { - add_handler(new Handler()); - } - - /** - * @brief Adds a URI websocket handler. Existing websocket handlers will be - * overwritten. - * - * @param uri String with the URI - * @param websocket_handler CivetServer pointer to the handler that to be - * added - */ - void add_websocket_handler(const std::string& uri, void *websocket_handler) - { - server_->addWebSocketHandler( - uri, - reinterpret_cast(websocket_handler)); - } - -private: - std::unique_ptr server_; - const ServerProperty& server_property_; - std::vector> handlers_; -}; - -}}}} // namespace rti::apputils::http::server - -#endif // HTTP_SERVER_HPP \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/ServerProperty.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/ServerProperty.hpp deleted file mode 100644 index 23e4c4529..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/ServerProperty.hpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HTTP_SERVER_PROPERTY_HPP -#define HTTP_SERVER_PROPERTY_HPP - -#include - -#include -#include - -#include "rti/apputils/util/Path.hpp" - -#include "rti/apputils/http/common/HttpUtils.hpp" - -namespace rti { namespace apputils { namespace http { namespace server { - -/** - * @brief This class contains the HTTP server properties - */ -class ServerProperty { -public: - /** - * @brief ServerProperty constructor - */ - ServerProperty(const std::string& ports = HTTP_SERVER_DEFAULT_PORT_STR) - : handle_options_request_(false) - { - listening_ports(ports); - } - - /** - * @brief Destroy the Server Property object - */ - virtual ~ServerProperty() = default; - - /** - * @brief Return the document root path. - * - * @return const std::string& - */ - const std::string& document_root() const - { - return document_root_; - } - - /** - * @brief Return the web server options. - * - * @return const std::vector& - */ - const std::vector& webserver_options() const - { - return webserver_options_; - } - - /** - * @brief Return the value of a web server options given it name. If the - * option is not found, the name will be returned. - * - * @return const std::string>& option value, or option name if not found. - */ - const std::string& webserver_option(std::string& name) const - { - auto it = std::find( - webserver_options_.begin(), - webserver_options_.end(), - name); - - if (it != webserver_options_.end() - && ++it != webserver_options_.end()) { - return *it; - } - - return name; - } - - /** - * @brief This method returns true if the server will handle OPTIONS - * requests, otherwise false. - * - * @return boolean - */ - bool handle_options_request() const - { - return handle_options_request_; - } - - /** - * @brief Set the document root path. - * - * @param document_root - * @return ServerProperty& - */ - ServerProperty& document_root(const std::string& document_root) - { - if (!document_root.empty()) { - document_root_ = util::Path(document_root); - RTI_SERVICE_CHECK_CONDITION_W_EXTRA_INFO( - document_root_.exists(), - "Document root path does not exist"); - set_webserver_option("document_root", document_root_.c_str()); - } - - return *this; - } - - /** - * @brief Set the listening ports. - * - * @param listening_ports - * @return ServerProperty& - */ - ServerProperty& listening_ports(const std::string& listening_ports) - { - listening_ports_ = listening_ports; - set_webserver_option("listening_ports", listening_ports.c_str()); - return *this; - } - - /** - * @brief This method enters a key-value pair into the webserver_options - * array. - * - * @param key Name of the option to be set. - * @param value Value of the option. - */ - ServerProperty& set_webserver_option(const char *key, const char *value) - { - // Check if the option already exists. - auto it = std::find( - webserver_options_.begin(), - webserver_options_.end(), - key); - // if exists modify the value - if (it != webserver_options_.end() - && ++it != webserver_options_.end()) { - *it = value; - } else { - // Add option name - webserver_options_.emplace_back(key); - // Add option value - webserver_options_.emplace_back(value); - } - - return *this; - } - - /** - * @brief This option enables the server to handle OPTIONS requests if true, - * otherwise civetweb will handle them. - * - * @param handle_options_request boolean value to handle OPTIONS requests. - * @return ServerProperty& - */ - ServerProperty& handle_options_request(bool handle_options_request) - { - handle_options_request_ = handle_options_request; - return *this; - } - - static std::string parse_port(const std::string& host) - { - std::string::size_type scheme_pos = host.find("://"); - if (scheme_pos == std::string::npos) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "Invalid scheme format"); - } - - std::string unformatted_host = host.substr(scheme_pos + 1); - - std::string::size_type port_pos = unformatted_host.find(":"); - if (port_pos == std::string::npos) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "Invalid host:port format"); - } - - std::string port_string = unformatted_host.substr(port_pos + 1); - - try { - // Check that port has a valid format - std::stoi(port_string); - } catch (...) { - std::string error_msg; - error_msg.append("Invalid port value: ").append(port_string); - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - error_msg.c_str()); - } - - return port_string; - } - -private: - // Server options - util::Path document_root_; - std::string listening_ports_; - std::vector webserver_options_; - bool handle_options_request_; -}; - -}}}} // namespace rti::apputils::http::server - -#endif // HTTP_SERVER_PROPERTY_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/WebSocketConnection.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/WebSocketConnection.hpp deleted file mode 100644 index bc9cdd72b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/WebSocketConnection.hpp +++ /dev/null @@ -1,320 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2024. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - - -#ifndef _WEBSOCKET_CONNECTION_H_ -#define _WEBSOCKET_CONNECTION_H_ - -#include -#include - -#include -#include -#include -#include - -namespace rti { namespace apputils { namespace websocket { - -/* - * This class wraps the state of the client connection. Every instance created - * from this class must be kept alive until the connection is closed. Whenever - * the server receives a new web_wait_factorysocket connection attempt, it - * creates a WebSocketConnection instance and this WebSocketConnection will be - * attached to the client connection. - * - * This class has the state of the client connection, the type of content that - * the client accepts and the bind ids that each connection have bound. - */ -class WebSocketConnection { -public: - explicit WebSocketConnection() - : state_(WebSocketStateKind::UNKNOWN), - content_type_(WebSocketContentType::UNKNOWN) - { } - - virtual ~WebSocketConnection() = default; - - /** - * Overloading the == operator to compare connections. - * @param conn A pointer to the connection to compare - */ - virtual bool operator==(WebSocketConnection *conn) = 0; - - /** - * This method returns the state of the connection - * @return WebSocketStateKind the current status - */ - WebSocketStateKind state() const - { - return state_; - } - - /** - * This method returns the content type accepted for the connection - * @return WebSocketContentType - */ - WebSocketContentType content_type() const - { - return content_type_; - } - - /** - * This method sets the state of the connection - * @param state WebSocketStateKind the new status - */ - void state(const WebSocketStateKind& state) - { - state_ = state; - } - - /** - * This method sets the content type accepted for the connection - * @param content WebSocketContentType - */ - void content_type(const WebSocketContentType& content) - { - content_type_ = content; - } - - /** - * This function sends a MG_WEBSOCKET_OPCODE_TEXT message to the user. - * @param msg The message string to be sent - */ - virtual void send(const StringBuffer& msg) = 0; - - /** - * This function sends a MG_WEBSOCKET_OPCODE_PONG message to the user. - * @param msg The message string to be sent - */ - virtual void send_pong(const StringBuffer& msg) = 0; - - /** - * This function creates the error message to the user. - * @param ex Excetion with the info of an issue - * @param save_ctx context with that point to the message - */ - void create_error( - RTIXMLSaveContext& save_ctx, - const rti::apputils::http::HttpException& ex) - { - struct DDS_PrintFormat format = DDS_PrintFormat_INITIALIZER; - DDS_PrintFormatProperty properties = DDS_PrintFormatProperty_INITIALIZER; - DDS_ReturnCode_t retcode = DDS_RETCODE_ERROR; - - if (content_type_ == WebSocketContentType::JSON) { - properties.kind = DDS_JSON_PRINT_FORMAT; - } else if (content_type_ == WebSocketContentType::XML) { - properties.kind = DDS_XML_PRINT_FORMAT; - } else { - properties.kind = DDS_XML_PRINT_FORMAT; - } - - retcode = DDS_PrintFormatProperty_to_print_format(&properties, &format); - - if (retcode != DDS_RETCODE_OK) { - RTI_THROW_HTTP_EXCEPTION( - rti::apputils::http::StatusCode::internal_server_error, - &RTI_LOG_ANY_FAILURE_s, - "Unsupported content type"); - } - - format.print_top_level_beginning(&format, &save_ctx, "error", 0); - - format.print_primitive_type_beginning(&format, &save_ctx, "code", 1); - RTIXMLSaveContext_freeform( - &save_ctx, - "%d", - ex.error_code()); - format.print_primitive_type_ending(&format, &save_ctx, "code", 1); - RTIXMLSaveContext_freeform(&save_ctx, "%s", format.element_separator); - - format.print_primitive_type_beginning(&format, &save_ctx, "message", 1); - RTIXMLSaveContext_freeform( - &save_ctx, - "%sError %s%s", - format.string_opening_delimiter, - ex.what(), - format.string_closing_delimiter); - format.print_primitive_type_ending(&format, &save_ctx, "message", 1); - RTIXMLSaveContext_freeform(&save_ctx, "%s", format.element_separator); - - format.print_primitive_type_beginning(&format, &save_ctx, "method", 1); - RTIXMLSaveContext_freeform( - &save_ctx, - "%s%s%s", - format.string_opening_delimiter, - RTI_FUNCTION_NAME, - format.string_closing_delimiter); - format.print_primitive_type_ending(&format, &save_ctx, "method", 1); - - format.print_top_level_ending(&format, &save_ctx, "error", 0); - - } - - /** - * This function sends an error message to the user. - * @param msg The error message that the error will have - */ - void send_error(const rti::apputils::http::HttpException& ex) - { - StringBuffer buffer; - - RTIXMLSaveContext save_ctx = RTIXMLSaveContext_INITIALIZER; - save_ctx.sout = (char*) buffer.c_str(); - - if (!RTIOsapiUtility_sizeToUInt32(save_ctx.ssize, buffer.capacity())) { - RTI_THROW_HTTP_EXCEPTION( - rti::apputils::http::StatusCode::internal_server_error, - &RTI_LOG_ANY_FAILURE_s, - "Error allocating string"); - } - - create_error(save_ctx, ex); - if (save_ctx.outputStringLength + 1 > buffer.capacity()) { - buffer.ensure_capacity(save_ctx.outputStringLength + 1); - - // Reset save_context - RTIXMLSaveContext_initialize(&save_ctx); - save_ctx.sout = (char *) buffer.c_str(); - - if (!RTIOsapiUtility_sizeToUInt32(save_ctx.ssize, buffer.capacity())) { - RTI_THROW_HTTP_EXCEPTION( - rti::apputils::http::StatusCode::internal_server_error, - &RTI_LOG_ANY_FAILURE_s, - "Error allocating string"); - } - - create_error(save_ctx, ex); - } - send(buffer); - } - - /** - * This function creates the request error message to the user. - * @param ex RequestExcetion with the info of an issue - * @param save_ctx context with that point to the message - */ - void create_request_error( - RTIXMLSaveContext& save_ctx, - const RequestException& ex) - { - struct DDS_PrintFormat format = DDS_PrintFormat_INITIALIZER; - DDS_PrintFormatProperty properties = DDS_PrintFormatProperty_INITIALIZER; - DDS_ReturnCode_t retcode = DDS_RETCODE_ERROR; - - if (content_type_ == WebSocketContentType::JSON) { - properties.kind = DDS_JSON_PRINT_FORMAT; - } else if (content_type_ == WebSocketContentType::XML) { - properties.kind = DDS_XML_PRINT_FORMAT; - } else { - properties.kind = DDS_XML_PRINT_FORMAT; - } - - retcode = DDS_PrintFormatProperty_to_print_format(&properties, &format); - - if (retcode != DDS_RETCODE_OK) { - RTI_THROW_HTTP_EXCEPTION( - rti::apputils::http::StatusCode::internal_server_error, - &RTI_LOG_ANY_FAILURE_s, - "Unsupported content type"); - } - - format.print_top_level_beginning( - &format, - &save_ctx, - WEBSOCKET_RESPONSE_NAME, - 0); - - format.print_primitive_type_beginning(&format, &save_ctx, "return_code", 1); - RTIXMLSaveContext_freeform( - &save_ctx, - "%d", - ex.error_code()); - format.print_primitive_type_ending(&format, &save_ctx, "return_code", 1); - RTIXMLSaveContext_freeform(&save_ctx, "%s", format.element_separator); - - format.print_primitive_type_beginning(&format, &save_ctx, "error", 1); - RTIXMLSaveContext_freeform( - &save_ctx, - "%s%s%s", - format.string_opening_delimiter, - ex.what(), - format.string_closing_delimiter); - format.print_primitive_type_ending(&format, &save_ctx, "error", 1); - RTIXMLSaveContext_freeform(&save_ctx, "%s", format.element_separator); - - format.print_primitive_type_beginning(&format, &save_ctx, "method", 1); - RTIXMLSaveContext_freeform( - &save_ctx, - "%s%s%s", - format.string_opening_delimiter, - ex.get_method_name(), - format.string_closing_delimiter); - format.print_primitive_type_ending(&format, &save_ctx, "method", 1); - - format.print_top_level_ending( - &format, - &save_ctx, - WEBSOCKET_RESPONSE_NAME, - 0); - } - - /** - * This function sends an REQUEST error message to the user. - * @param msg The error message that the error will have - */ - void send_request_error(const RequestException& ex) - { - StringBuffer buffer; - - RTIXMLSaveContext save_ctx = RTIXMLSaveContext_INITIALIZER; - - save_ctx.sout = (char*) buffer.c_str(); - - if (!RTIOsapiUtility_sizeToUInt32(save_ctx.ssize, buffer.capacity())) { - RTI_THROW_HTTP_EXCEPTION( - rti::apputils::http::StatusCode::internal_server_error, - &RTI_LOG_ANY_FAILURE_s, - "Error allocating string"); - } - - create_request_error(save_ctx, ex); - if (save_ctx.outputStringLength + 1 > buffer.capacity()) { - buffer.ensure_capacity(save_ctx.outputStringLength + 1); - - // Reset save_context - RTIXMLSaveContext_initialize(&save_ctx); - save_ctx.sout = (char *) buffer.c_str(); - - if (!RTIOsapiUtility_sizeToUInt32(save_ctx.ssize, buffer.capacity())) { - RTI_THROW_HTTP_EXCEPTION( - rti::apputils::http::StatusCode::internal_server_error, - &RTI_LOG_ANY_FAILURE_s, - "Error allocating string"); - } - - create_request_error(save_ctx, ex); - } - send(buffer); - } - - /** - * This function close a WebSocketConnection. - * @param exception with the error message that happend - */ - virtual void close() = 0; - -private: - WebSocketStateKind state_; - WebSocketContentType content_type_; -}; - -}}} // namespace rti::webdds::websocket -#endif // _WEBSOCKET_CONNECTION_H_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebHandler.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebHandler.hpp deleted file mode 100644 index 8a4fd2817..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebHandler.hpp +++ /dev/null @@ -1,209 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2015. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef CIVETWEB_HANDLER_HPP -#define CIVETWEB_HANDLER_HPP - -#include - -#include -#include - -#include "rti/apputils/http/server/ServerProperty.hpp" -#include "rti/apputils/http/server/Connection.hpp" -#include "rti/apputils/http/server/RequestHandler.hpp" - -namespace rti { namespace apputils { namespace http { namespace server { - -// Forward declaration -class Server; - -/** - * @brief WebHandler implements the handler functions of CivetWeb's API, - * wrapping the calls to the generic RequestHandler. The Request is specialized - * to an specific kind of request handler (e.g., PublisherHandler) whose type is - * specified via template. - */ -class CivetWebHandler : public CivetHandler { -public: - /** - * @brief Constructor of the CivetWebHandler class. It calls the constructor - * of the specific RequestHandler it implements (i.e., handler) - * - * @param web_server_property Reference to the ServerProperty that will - * be used by the RequestHandler. - * @param server Web's server. - */ - explicit CivetWebHandler( - const ServerProperty& web_server_property, - Server& server, - RequestHandler *handler) - : web_server_property_(web_server_property), - server_(server), - handler_(handler), - callbacks_counter_(0) - { } - - /** - * @brief Destructor of the CivetWebHandler class. - */ - virtual ~CivetWebHandler() = default; - - /** - * @brief This method handles the POST operation. - * - * @param server CivetWeb's server. - * @param conn CiveWeb's connection. - * @return Always returns true given the fact that the operation is always - * processed by the underlying interfaces. - */ - virtual bool handlePost(CivetServer *, struct mg_connection *conn) final - { - CounterGuard guard { callbacks_counter_ }; - Connection connection(conn); - handler_->handle_post(server_, connection, web_server_property_); - - return true; - } - - /** - * @brief This method handles the PUT operation. - * - * @param server CivetWeb's server. - * @param conn CiveWeb's connection. - * @return Always returns true given the fact that the operation is always - * processed by the underlying interfaces. - */ - virtual bool handlePut(CivetServer *, struct mg_connection *conn) final - { - CounterGuard guard { callbacks_counter_ }; - Connection connection(conn); - handler_->handle_put(server_, connection, web_server_property_); - - return true; - } - - /** - * @brief This method handles the GET operation. - * - * @param server CivetWeb's server. - * @param conn CiveWeb's connection. - * @return Always returns true given the fact that the operation is always - * processed by the underlying interfaces. - */ - virtual bool handleGet(CivetServer *, struct mg_connection *conn) final - { - CounterGuard guard { callbacks_counter_ }; - Connection connection(conn); - handler_->handle_get(server_, connection, web_server_property_); - - return true; - } - - /** - * @brief This method handles the DELETE operation. - * - * @param server CivetWeb's server. - * @param conn CiveWeb's connection. - * @return Always returns true given the fact that the operation is always - * processed by the underlying interfaces. - */ - virtual bool handleDelete(CivetServer *, struct mg_connection *conn) final - { - CounterGuard guard { callbacks_counter_ }; - Connection connection(conn); - handler_->handle_delete(server_, connection, web_server_property_); - - return true; - } - - /** - * @brief This method handles the OPTIONS operation. - * - * @param server CivetWeb's server. - * @param conn CiveWeb's connection. - * @return true if the request was processed by the custom handler, - * otherwise false. - */ - virtual bool handleOptions(CivetServer *, struct mg_connection *conn) final - { - CounterGuard guard { callbacks_counter_ }; - if (web_server_property_.handle_options_request()) { - Connection connection(conn); - handler_->handle_options(server_, connection, web_server_property_); - return true; - } - - return false; - } - - /** - * @brief This method handles the HEAD operation. - * - * @param server CivetWeb's server. - * @param conn CiveWeb's connection. - * @return Always returns true given the fact that the operation is always - * processed by the underlying interfaces. - */ - virtual bool handleHead(CivetServer *, struct mg_connection *conn) final - { - CounterGuard guard { callbacks_counter_ }; - Connection connection(conn); - handler_->handle_head(server_, connection, web_server_property_); - - return true; - } - - /** - * @brief This method handles the PATCH operation. - * - * @param server CivetWeb's server. - * @param conn CiveWeb's connection. - * @return Always returns true given the fact that the operation is always - * processed by the underlying interfaces. - */ - virtual bool handlePatch(CivetServer *, struct mg_connection *conn) final - { - CounterGuard guard { callbacks_counter_ }; - Connection connection(conn); - handler_->handle_patch(server_, connection, web_server_property_); - - return true; - } - - bool callbacks_running() const - { - return callbacks_counter_ != 0; - } - -private: - struct CounterGuard { - CounterGuard(std::atomic_short& counter) : counter_(counter) - { - ++counter_; - } - - ~CounterGuard() - { - --counter_; - } - - std::atomic_short& counter_; - }; - - const ServerProperty& web_server_property_; - Server& server_; - std::unique_ptr handler_; - std::atomic_short callbacks_counter_; -}; - -}}}} // namespace rti::apputils::http::server - -#endif // CIVETWEB_HANDLER_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebSocketHandlerImpl.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebSocketHandlerImpl.hpp deleted file mode 100644 index 42cd52a8d..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/CivetWebSocketHandlerImpl.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2024. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef CIVETWEB_WEBSOCKET_HANDLER_H -#define CIVETWEB_WEBSOCKET_HANDLER_H - -#include -#include - -#include -#include - -namespace rti { namespace apputils { namespace websocket { namespace civetweb { - -/** - * This class implements the CivetWebSocketHandler interface, which is part - * of the CivetWeb API. This class has a WebSocketHandler. It allows us - * to isolate the WebSocket handling that CivetWeb does and the WebSocket - * handling that our WebSocketAPI implements - */ -class CivetWebSocketHandlerImpl : public CivetWebSocketHandler { -public: - CivetWebSocketHandlerImpl(WebSocketHandler& handler) : handler_(handler) - { } - - /** - * This method handles new client connections to the server. For such - * purpose, it creates a new `WebSocketConnection` and attaches it to the - * internal CivetWeb `mg_connection`. This mechanisms allows existing - * connections to be reused in the future. - * @param server CivetWeb server. Unused parameter. - * @param conn CivetWeb connection. - * @return Boolean value indicating the success or failure of the operation. - */ - bool handleConnection(CivetServer *, const struct mg_connection *conn) - { - WebSocketConnection *client_conn = - new CivetWebSocketConnection(const_cast(conn)); - - handler_.handle_connection(*client_conn); - mg_set_user_connection_data(const_cast(conn), client_conn); - - /* - * client_conn is not being leaked here, it's stored indirectly - * in the user connection data that can be get by calling - * mg_get_user_connection_data as we can see on handleClose. - */ - /* coverity[leaked_storage : FALSE] */ - return true; - } - /** - * This method is called when a client connection has ended the handshake - * protocol with success. - * @param server CivetWeb server. Unused parameter. - * @param conn CivetWeb connection - */ - void handleReadyState(CivetServer *, struct mg_connection *conn) - { - WebSocketConnection *client = static_cast( - mg_get_user_connection_data(conn)); - handler_.handle_ready_state(*client); - } - - /** - * This method is called every time a client sends a message to the server - * through the WebSocket connection. - * @param server CivetWeb server. Unused parameter - * @param conn CivetWeb connection - * @param bits A byte with the kind of data (TEXT, PONG, ...) - * @param data String containing the received message, it is not - * null-terminated - * @param data_size String size, the size of the string without the null - * character. - */ - bool handleData( - CivetServer *, - struct mg_connection *conn, - int bits, - char *data, - size_t data_len) - { - StringBuffer msg; - WebSocketConnection *client = static_cast( - mg_get_user_connection_data(conn)); - // The last byte of the bits say what kind of message it is - switch (((unsigned char) bits) & 0x0F) { - case MG_WEBSOCKET_OPCODE_TEXT: - // This marks the end of the string - *(data + data_len) = '\0'; - msg = StringBuffer(data); - try { - handler_.handle_data(*client, msg); - } catch (const RequestException& ex) { - DDSLog_exception(&RTI_LOG_ANY_FAILURE_s, ex.what()); - client->send_request_error(ex); - } catch (const rti::apputils::http::HttpException& ex) { - DDSLog_exception(&RTI_LOG_ANY_FAILURE_s, ex.what()); - client->send_error(ex); - } catch (...) { - std::string message = "Unexpected exception. The connection will be closed."; - DDSLog_exception(&RTI_LOG_ANY_FAILURE_s, message.c_str()); - message.append(": "); - message.append(RTI_FUNCTION_NAME); - client->send(message); - - // Close the connection (Especially to avoid vulnerabilities) - client->state(WebSocketStateKind::CLOSE); - client->close(); - } - break; - case MG_WEBSOCKET_OPCODE_PING: - // This marks the end of the string - data[data_len] = '\0'; - msg = StringBuffer(data); - // just send back the message data in a pong frame - client->send_pong(msg); - break; - default: - break; - } - - return true; - } - - /** - * This method is called when a client closes the connection. The method - * deletes the connection object. - * @param server CivetWeb Server - * @param conn CivetWeb connection - */ - void handleClose(CivetServer *, const struct mg_connection *conn) - { - struct mg_context *ctx = mg_get_context(conn); - WebSocketConnection *client = - static_cast(mg_get_user_connection_data(conn)); - - if (client->state() != WebSocketStateKind::CLOSE){ - handler_.handle_close(*client); - } - - mg_lock_context(ctx); - delete client; - mg_set_user_connection_data(const_cast(conn), NULL); - mg_unlock_context(ctx); - } - - ~CivetWebSocketHandlerImpl() - { - } - -private: - WebSocketHandler& handler_; -}; - -}}}} // namespace rti::webdds::websocket::civetweb - - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/WebSocketHandler.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/WebSocketHandler.hpp deleted file mode 100644 index 34690210e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/http/server/detail/WebSocketHandler.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2024. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ -#ifndef WEBSOCKET_HANDLER_HPP -#define WEBSOCKET_HANDLER_HPP - -#include -#include - -namespace rti { namespace apputils { namespace websocket { - -/** - * This class is a generic handler for WebSocket communication. It - * implements methods that handle all the different events that can be - * triggered in the context of a WebSocket connection. - */ -class WebSocketHandler { -public: - /** - * This method is called when a client establishes a connection with the - * server. When that happens, we set the status of the WebSocketConnection - * to WebSocketStatus_CREATED. - * @param conn WebSocketConnection connection that will be created - */ - virtual void handle_connection(WebSocketConnection& conn) = 0; - - /** - * This method is called when the websocket's handshake protocol has - * ended successfully. The state of the connection is marked as - * WebSocketStateKind::OPEN. - * @param conn WebSocketConnection connection that will be updated - */ - virtual void handle_ready_state(WebSocketConnection& conn) = 0; - - /** - * This method is called every time a client sends a message. The message is - * wrapped in a StringBuffer. Upon reception, the method identifies the - * message kind and calls the appropriate Handler for that kind of message. - * @param conn WebSocketConnection connection that sent the message - * @param msg StringBuffer with the corresponding message - */ - virtual void handle_data( - WebSocketConnection& conn, - const StringBuffer& msg) = 0; - - /** - * This method is called when a client closes a connection with the server. - * It detaches all conditions that have been previously attached to the - * connection. - * @param conn WebSocketConnection connection that will be closed - */ - virtual void handle_close(WebSocketConnection& conn) = 0; -}; - -}}} // namespace rti::apputils::websocket - -#endif // WEBSOCKET_HANDLER_HPP diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/log/LogConfig.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/log/LogConfig.hpp deleted file mode 100644 index 604e44623..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/log/LogConfig.hpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - (c) Copyright, Real-Time Innovations, 2017- - All rights reserved. - - No duplications, whole or partial, manual or electronic, may be made without - express written permission. Any such copies, or revisions thereof, must - display this notice unaltered. - - This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef HPP_SERVICE_LOG_CONFIG_HPP_ -#define HPP_SERVICE_LOG_CONFIG_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include - -#include "log/log_common.h" - -#include -#include -#include - -#define RTI_SUBMODULE_MASK_ALL (0xFFFF) - -namespace rti { namespace apputils { namespace log { - -/** - * @deprecated This class is deprecated and may be removed in future releases. - * - * @brief This class is used to configure the logging verbosity and mask of a - * Logger instance. - */ -class LogConfig { -public: - - static LogConfig& instance() - { - static LogConfig singleton; - return singleton; - } - - RTILogBitmap instrumentation_mask() const - { - return instrumentation_mask_; - } - - LogConfig& instrumentation_mask(RTILogBitmap logmask) - { - instrumentation_mask_ = logmask; - return *this; - } - - rti::config::Verbosity verbosity() - { - return static_cast(instrumentation_mask_); - } - - void verbosity(rti::config::Verbosity verbosity) - { - instrumentation_mask( - static_cast(verbosity.underlying())); - } - - ~LogConfig() - { - } - - static RTILogBitmap mask_all() - { - return RTI_SUBMODULE_MASK_ALL; - } - - static RTILogBitmap mask_none() - { - return 0; - } - -protected: - - // Constructor is private: this class is a singleton - LogConfig() - : instrumentation_mask_(RTI_LOG_BITMAP_DEFAULT) - { - RTILog_appendPrintMask(RTI_LOG_PRINT_BIT_AT_METHOD); - } - - RTILogBitmap instrumentation_mask_; -}; - -inline -rti::config::Verbosity dds_verbosity_from_level(int32_t level) -{ - switch (level) { - case 6: - return rti::config::Verbosity::STATUS_REMOTE; - case 5: - /* no break */ - case 4: - return rti::config::Verbosity::WARNING; - case 3: - /* no break */ - case 2: - /* no break */ - case 1: - return rti::config::Verbosity::EXCEPTION; - case 0: - return rti::config::Verbosity::SILENT; - default: - return rti::config::Verbosity::EXCEPTION; - } -} - -inline -rti::config::Verbosity service_verbosity_from_level(int32_t level) -{ - RTILogBitmap native_verbosity = RTI_LOG_BITMAP_NONE; - - switch (level) { - /* no break */ - case 6: - native_verbosity |= RTI_LOG_BIT_CONTENT; - /* no break */ - case 5: - native_verbosity |= RTI_LOG_BIT_PERIODIC; - /* no break */ - case 4: - native_verbosity |= RTI_LOG_BIT_REMOTE; - /* no break */ - case 3: - native_verbosity |= RTI_LOG_BIT_LOCAL; - /* no break */ - case 2: - native_verbosity |= RTI_LOG_BIT_WARN; - /* no break */ - case 1: - native_verbosity |= RTI_LOG_BIT_EXCEPTION | RTI_LOG_BIT_FATAL_ERROR; - break; - case 0: - break; - default: - native_verbosity = RTI_LOG_BITMAP_DEFAULT; - break; - } - - return static_cast(native_verbosity); - -} - -/* - * Example: - * MyCatcherMethod: caught exception from: - * MyThrowerMethod:!init failure - */ -inline void log_service_exception( - RTILogBitmap instrumentation_mask, - const rti::apputils::ServiceException& exception, - const char *method_name) -{ - RTILogMessage log_message; - - log_message.format = "caught exception from:\n %s"; - log_message.messageId = exception.message_id(); - - if (instrumentation_mask & RTI_LOG_BIT_EXCEPTION) { - RTILogMessage_printWithParams( - RTI_LOG_PRINT_FORMAT_MASK_ALL_EXCEPT_LOCATION_FILELINE_AND_MODULE, - RTI_LOG_BIT_EXCEPTION, - MODULE_LOG, - NULL, /* filename */ - 0, /* lineno */ - method_name, - &log_message, - exception.what()); - } -} - -} } } /* namespace rti::apputils::log */ - - -/* ================================================================= */ -/* Logging macros */ -/* ================================================================= */ - -/* ----------------------------------------------------------------- */ -/*i - * @brief See \ref RTILogCategory_log - */ -#define SERVICELogger_log(instrumentationBit__, logMessage__, worker__, ...) \ - RTILogCategory_log( \ - (MODULE_LOG_CONFIG).instrumentation_mask(), \ - RTI_SUBMODULE_MASK_ALL, \ - RTI_SUBMODULE_MASK_ALL, \ - (instrumentationBit__), \ - DEFINE_MODULE_NUMBER(MODULE_NS), \ - (logMessage__), \ - (worker__), \ - __VA_ARGS__) - -/* - * --- C-like logger macros --------------------------------------------------- - */ -#define SERVICELog_fromException(SERVICE_EXCEPTION) \ - rti::apputils::log::log_service_exception( \ - (MODULE_LOG_CONFIG).instrumentation_mask(), \ - SERVICE_EXCEPTION, \ - RTI_FUNCTION_NAME) - -/* - * For legacy reasons, we keep the definition of freeForm. - * freeForm is now deprecated and it should not be used anymore. - * These are the alternatives to freeForm (only to be used in test code or - * non-production code, like an instrumented build): - * - If you need to log (verbosity filtered) an unformatted parameterized string - * you can use RTITestLog_logParamString (in tests) or - * RTILogParamString_logUnformatted (in non-test, instrumented build code). - * This is equivalent to old freeForm(). - * - If you just need to print (not verbosity filtered) an unformatted parameterized - * string, use RTILogParamString_printPlain. - * - Finally, if you need print a formatted parameterized string, use RTILogParamString_print. - */ -#define SERVICELog_freeForm(INSTRUMENT_BIT, ...) \ - RTILogParamString_logUnformatted( \ - (MODULE_LOG_CONFIG).instrumentation_mask(), \ - RTI_SUBMODULE_MASK_ALL, \ - RTI_SUBMODULE_MASK_ALL, \ - (INSTRUMENT_BIT), \ - __VA_ARGS__) - -#define SERVICELog_logMessage(INSTRUMENT_BIT, ...) \ - RTILogMessage_log( \ - (MODULE_LOG_CONFIG).instrumentation_mask(), \ - RTI_SUBMODULE_MASK_ALL, \ - RTI_SUBMODULE_MASK_ALL, \ - RTI_LOG_PRINT_FORMAT_MASK_ALL_EXCEPT_LOCATION, \ - (INSTRUMENT_BIT), \ - DEFINE_MODULE_NUMBER(MODULE_NS), \ - __VA_ARGS__) - -#define SERVICELogMessage_log(INSTRUMENT_BIT, ...) \ - RTILogMessage_log( \ - (MODULE_LOG_CONFIG).instrumentation_mask(), \ - RTI_SUBMODULE_MASK_ALL, \ - RTI_SUBMODULE_MASK_ALL, \ - RTI_LOG_PRINT_FORMAT_MASK_ALL, \ - (INSTRUMENT_BIT), \ - DEFINE_MODULE_NUMBER(MODULE_NS), \ - __VA_ARGS__) - -#define SERVICELog_exception(...) \ - SERVICELogMessage_log(RTI_LOG_BIT_EXCEPTION, __VA_ARGS__) - -#define SERVICELog_warn(...) \ - SERVICELogMessage_log(RTI_LOG_BIT_WARN, __VA_ARGS__) - -#define SERVICELog_local(...) \ - SERVICELogMessage_log(RTI_LOG_BIT_LOCAL, __VA_ARGS__) - -#define SERVICELog_content(...) \ - SERVICELogMessage_log(RTI_LOG_BIT_CONTENT, __VA_ARGS__) - -#define SERVICELog_remote(...) \ - SERVICELogMessage_log(RTI_LOG_BIT_REMOTE, __VA_ARGS__) - - -#define SERVICELog_any(INSTRUMENT_BIT, ...) \ - if ((((MODULE_LOG_CONFIG).instrumentation_mask()) & (INSTRUMENT_BIT)) \ - && ((RTI_SUBMODULE_MASK_ALL) & (RTI_SUBMODULE_MASK_ALL))) - -#define SERVICELog_flushActivityContextWithAction(INSTRUMENT_BIT, ACTION) \ - SERVICELog_logMessage((INSTRUMENT_BIT), &RTI_LOG_ANY_s, (ACTION)); - -#define SERVICELog_flushActivityContext(INSTRUMENT_BIT) \ - SERVICELog_logMessage((INSTRUMENT_BIT), &RTI_LOG_ANY_s, ""); - -/* - * The macro: - * - Creates a contextScope - * - Enter a resource entry into the context. - * - Enter an activity entry into the context. - * - * When the function where the macro is called is end, the destructor of - * the contextScope will be called and the entries will leave the context. - */ -#define RTI_SERVICE_CONTEXT_ENTER( \ - RESOURCE_ID, \ - ...) \ - rti::advlog::ContextScope context_scope_guard_implicit__; \ - context_scope_guard_implicit__.enter(RESOURCE_ID); \ - context_scope_guard_implicit__.enter(__VA_ARGS__) - -#define RTI_SERVICE_CONTEXT_ENTER_LOG( \ - RESOURCE_ID, \ - ...) \ - RTI_SERVICE_CONTEXT_ENTER( \ - RESOURCE_ID, \ - __VA_ARGS__); \ - SERVICELog_flushActivityContext(RTI_LOG_BIT_LOCAL) - -#endif /* HPP_SERVICE_LOG_CONFIG_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Counters.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Counters.hpp deleted file mode 100644 index d76f49911..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Counters.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * $Id$ - * - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_MONITORING_COUNTERS_HPP_ -#define HPP_SERVICE_MONITORING_COUNTERS_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include - -namespace rti { namespace apputils { namespace monitoring { - -struct NetworkPerformanceCounters { - - NetworkPerformanceCounters() - :received_samples(0), received_bytes(0), latency_ms(0) - { - } - - int64_t received_samples; - int64_t received_bytes; - int64_t latency_ms; -}; - -} } }// rti::apputils::monitoring - -#endif /* HPP_SERVICE_MONITORING_COUNTERS_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Utils.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Utils.hpp deleted file mode 100644 index 96943be73..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/monitoring/Utils.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * $Id$ - * - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_MONITORING_UTILS_HPP_ -#define HPP_SERVICE_MONITORING_UTILS_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include "osapi/osapi_host.h" -#include "osapi/osapi_process.h" -#include "apputils/apputils_monitoring.h" - -#include -#include - -namespace rti { namespace apputils { namespace monitoring { - -inline -void compute_object_id( - rti::core::Guid& out_guid, - const rti::core::Guid& application_id, - const rti::apputils::ResourceIdentifier& resource_id) -{ - APPUTILSMonitoringSupport_compute_resource_guid( - &out_guid.native(), - &application_id.native(), - &resource_id.native()); -} - -inline -void compute_application_guid( - rti::core::Guid &out_guid, - const std::string& application_name) -{ - APPUTILSMonitoringSupport_compute_application_guid( - &out_guid.native(), - application_name.c_str()); -} - -} } }// rti::apputils::monitoring - -#endif /* HPP_SERVICE_MONITORING_UTILS_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/SqliteVerifier.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/SqliteVerifier.hpp deleted file mode 100644 index ddf2f83b8..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/SqliteVerifier.hpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - (c) Copyright, Real-Time Innovations, 2023-. - All rights reserved. - No duplications, whole or partial, manual or electronic, may be made - without express written permission. Any such copies, or - revisions thereof, must display this notice unaltered. - This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef HPP_APPUTILS_SQLITEVERIFIER_HPP_ -#define HPP_APPUTILS_SQLITEVERIFIER_HPP_ - -#include "rti/apputils/SQLiteConnection.hpp" -#include "rti/apputils/test/TestFramework.hpp" -#include "rti/util/util.hpp" - -#include "rti/recording/storage/EStorageFormat.hpp" - -namespace rti { namespace apputils { namespace test { - -/** - * @brief Basic utility class with different checks for an SQLite Connection. - */ -class SQLiteVerifierBase { -public: - - SQLiteVerifierBase(rti::apputils::SQLiteConnection& connection) : - connection_(connection) { } - - bool check_table_exists(const std::string& table) - { - std::ostringstream string_stream; - string_stream << "SELECT name FROM sqlite_master WHERE name = '"; - string_stream << table; - string_stream << "'"; - - rti::apputils::SQLiteConnection::RowIterator row_it = - connection_.begin(string_stream.str()); - if (!row_it.at_end()) { - return true; - } - return false; - } - - bool wait_till_table_exists( - const std::string& table, - const unsigned int seconds = DEFAULT_TEST_TIMEOUT_SEC) - { - bool exists = check_table_exists(table); - dds::core::Duration sleepDuration(1,0); - for (uint32_t i = 0; i < seconds && !exists; i++) { - rti::util::sleep(sleepDuration); - exists = check_table_exists(table); - } - if (!exists) { - RTITestLogger_log( - RTI_LOG_BIT_EXCEPTION, - &RTI_TEST_LOG_FAILURE_TEMPLATE, - "Table not found: %s", - table.c_str()); - } - return exists; - } - - bool check_column_exists( - const std::string& table, - const std::string& column) - { - std::ostringstream string_stream; - string_stream << "PRAGMA table_info([" << table << "])"; - - rti::apputils::SQLiteConnection::RowIterator row_it = - connection_.begin(string_stream.str()); - while (!row_it.at_end()) { - std::string column_name; - row_it.get(1, column_name); - if (column_name.compare(column) == 0) { - return true; - } - ++row_it; - } - return false; - } - - - uint32_t num_rows_for_statement(const std::string& sql) - { - rti::apputils::SQLiteConnection::RowIterator row_it = - connection_.begin(sql); - uint32_t row_count = 0; - while (!row_it.at_end()) { - row_count++; - ++row_it; - } - return row_count; - } - - /** - * @pre check_table_exists(table) == true - */ - uint32_t num_rows( - const std::string& table, - const bool filter_invalid = false) - { - std::ostringstream string_stream; - string_stream << "SELECT COUNT(*) FROM [" << table << "]"; - if (filter_invalid) { - string_stream << " WHERE SampleInfo_valid_data = 1"; - } - rti::apputils::SQLiteConnection::RowIterator row_it = - connection_.begin(string_stream.str()); - int64_t value = 0; - row_it.get(0, value); - return (uint32_t) value; - } - - bool check_num_rows( - const std::string& table, - const uint32_t expected_count, - const bool filter_invalid = false) - { - try { - RTI_TEST_ASSERT_EQUALS_INT( - expected_count, - num_rows(table, filter_invalid)); - } catch (const std::exception&) { - return false; - } - return true; - } - - bool check_num_rows_for_statement( - const std::string& sql, - const unsigned int expected_count) - { - try { - RTI_TEST_ASSERT_EQUALS_INT( - expected_count, - num_rows_for_statement(sql)); - } catch (const std::exception&) { - return false; - } - return true; - } - - bool wait_till_num_rows( - const std::string& table, - const unsigned int expected_count, - const bool filter_invalid = false, - const unsigned int seconds = DEFAULT_TEST_TIMEOUT_SEC) - { - try { - RTI_TEST_WAIT_FOR_EQUALS_INT( - expected_count, - num_rows(table, filter_invalid), - static_cast(seconds)); - } catch (const std::exception& ex) { - RTITestLogger_log( - RTI_LOG_BIT_EXCEPTION, - &RTI_TEST_LOG_FAILURE_TEMPLATE, - "exception thrown: %s", - ex.what()); - return false; - } - return true; - } - - bool wait_till_num_rows_for_statement( - const std::string& sql, - const unsigned int expected_count, - const unsigned int seconds = DEFAULT_TEST_TIMEOUT_SEC) - { - try { - RTI_TEST_WAIT_FOR_EQUALS_INT( - expected_count, - num_rows_for_statement(sql), - static_cast(seconds)); - } catch (const std::exception& ex) { - RTITestLogger_log( - RTI_LOG_BIT_EXCEPTION, - &RTI_TEST_LOG_FAILURE_TEMPLATE, - "exception thrown: %s", - ex.what()); - return false; - } - return true; - } - - bool check_num_rows_invariant( - const std::string& table, - const unsigned int expected_count, - const bool filter_invalid = false, - const unsigned int seconds = DEFAULT_TEST_TIMEOUT_SEC) - { - const struct RTINtpTime sleepTime = {0,429496730}; - int sleeps = 0; - bool result = check_num_rows(table, expected_count, filter_invalid); - while(result && sleeps < (static_cast(seconds)) * 10) { - RTIOsapiThread_sleep(&sleepTime); - ++sleeps; - result = check_num_rows(table, expected_count, filter_invalid); - } - return result; - } - -protected: - - rti::apputils::SQLiteConnection& connection_; -}; - -} } } /* namespace rti::apputils::test */ - - -#endif /* HPP_APPUTILS_SQLITEVERIFIER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestFramework.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestFramework.hpp deleted file mode 100644 index 8901fa8e4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestFramework.hpp +++ /dev/null @@ -1,1506 +0,0 @@ -/* - (c) Copyright, Real-Time Innovations, 2016-. - All rights reserved. - No duplications, whole or partial, manual or electronic, may be made - without express written permission. Any such copies, or - revisions thereof, must display this notice unaltered. - This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef HPP_APPUTILS_FRAMEWORK_HPP_ -#define HPP_APPUTILS_FRAMEWORK_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rtitest/test_setting.h" -#include "osapi/osapi_heap.h" -#include "osapi/osapi_process.h" -#ifndef property_propertyNames_h - #include "property/property_propertyNames.h" -#endif -#include "pres/pres_common.h" - -#include - -#include "rti/test/generic_tests.hpp" -#include "rti/test/AbstractDomainTester.hpp" -#include "rtitest/Tester.hpp" -#include "rti/test/utilities.hpp" -#include "rti/apputils/util/Path.hpp" -#include "rti/apputils/util/Utils.hpp" -#include "dds/core/Time.hpp" - -#include "dds/dds.hpp" - -#include "dds/pub/DataWriter.hpp" -#include "dds/sub/DataReader.hpp" -#include "dds/pub/Publisher.hpp" -#include "rti/core/ListenerBinder.hpp" -#include "rti/core/constants.hpp" - -namespace rti { namespace apputils { namespace test { - -/** - * A set of utility functions to use in the tests. - */ -class TestUtils { -public: - - static std::string get_executable_path(const RTITestSetting *settings) { - char path[RECORDER_FILE_PATH_MAX_LENGTH] = ""; - - RTI_TEST_ASSERT( - RTIOsapiUtility_getExecutablePath( - path, - RECORDER_FILE_PATH_MAX_LENGTH + 1, - settings->execPath)); - - return std::string(path); - } - - static std::string get_resource_path( - const RTITestSetting *settings, - const std::string& file) - { - char resource_path[RECORDER_FILE_PATH_MAX_LENGTH] = ""; - - RTI_TEST_ASSERT( - RTITestSetting_getFullResourcePathFileName( - settings, - resource_path, - file.c_str())); - - return std::string(resource_path); - } - - /** - * Build a multi-file string, prepending the default DDS QoS file to the - * file name passed as a parameter. Recall that files are separated by the - * ';' character. - */ - static const std::string build_config_file( - const RTITestSetting *settings, - const std::string& config_file_name) - { - std::stringstream config_file_stream; - config_file_stream << get_resource_path( - settings, - "/xml/USER_QOS_PROFILES.xml"); - config_file_stream << ";"; - config_file_stream << get_resource_path(settings, config_file_name); - return config_file_stream.str(); - } - - static int64_t get_cache_sample_count(DDS_DataReader *reader) - { - DDS_DataReaderCacheStatus cache_status = - DDS_DataReaderCacheStatus_INITIALIZER; - DDS_ReturnCode_t retcode = - DDS_DataReaderCacheStatus_initialize(&cache_status); - RTI_TEST_ASSERT(retcode == DDS_RETCODE_OK); - std::shared_ptr cache_status_ptr( - &cache_status, - DDS_DataReaderCacheStatus_finalize); - - retcode = DDS_DataReader_get_datareader_cache_status( - reader, - &cache_status); - RTI_TEST_ASSERT(retcode == DDS_RETCODE_OK); - return cache_status.sample_count; - } - - static int32_t get_matched_participant_count( - DDS_DomainParticipant *participant) - { - DDS_InstanceHandleSeq participant_handles = DDS_SEQUENCE_INITIALIZER; - RTI_TEST_ASSERT(DDS_InstanceHandleSeq_initialize(&participant_handles)); - /* - * Using std::shared_ptr because we just want RAII semantics and the - * construction of the smart pointer is easier than that of a - * std::unique_ptr. - */ - std::shared_ptr participant_handles_ptr( - &participant_handles, - DDS_InstanceHandleSeq_finalize); - DDS_ReturnCode_t retcode = - DDS_DomainParticipant_get_discovered_participants( - participant, - &participant_handles); - RTI_TEST_ASSERT(retcode == DDS_RETCODE_OK); - int32_t num_participants = - DDS_InstanceHandleSeq_get_length(&participant_handles); - return num_participants; - } - - static int32_t get_matched_publications_count(DDS_DataReader *reader) - { - DDS_InstanceHandleSeq publication_handles = DDS_SEQUENCE_INITIALIZER; - RTI_TEST_ASSERT(DDS_InstanceHandleSeq_initialize(&publication_handles)); - /* - * Using std::shared_ptr because we just want RAII semantics and the - * construction of the smart pointer is easier than that of a - * std::unique_ptr. - */ - std::shared_ptr publication_handles_ptr( - &publication_handles, - DDS_InstanceHandleSeq_finalize); - - DDS_ReturnCode_t retcode = DDS_DataReader_get_matched_publications( - reader, - &publication_handles); - RTI_TEST_ASSERT(retcode == DDS_RETCODE_OK); - int32_t num_publications = - DDS_InstanceHandleSeq_get_length(&publication_handles); - return num_publications; - } - - static int32_t get_matched_subscriptions_count(DDS_DataWriter *writer) - { - DDS_InstanceHandleSeq subscription_handles = DDS_SEQUENCE_INITIALIZER; - RTI_TEST_ASSERT(DDS_InstanceHandleSeq_initialize(&subscription_handles)); - /* - * Using std::shared_ptr because we just want RAII semantics and the - * construction of the smart pointer is easier than that of a - * std::unique_ptr. - */ - std::shared_ptr subscription_handles_ptr( - &subscription_handles, - DDS_InstanceHandleSeq_finalize); - - DDS_ReturnCode_t retcode = DDS_DataWriter_get_matched_subscriptions( - writer, - &subscription_handles); - RTI_TEST_ASSERT(retcode == DDS_RETCODE_OK); - int32_t num_subscriptions = - DDS_InstanceHandleSeq_get_length(&subscription_handles); - return num_subscriptions; - } - -}; - -class ParticipantBuiltinTopicListener : - public dds::all::NoOpDataReaderListener< - dds::topic::ParticipantBuiltinTopicData> -{ -public: - ParticipantBuiltinTopicListener() { } - - void on_data_available( - dds::sub::DataReader& reader) - { - dds::sub::LoanedSamples< - dds::topic::ParticipantBuiltinTopicData> samples = reader.read(); - dds::domain::DomainParticipant local_participant = - reader.subscriber().participant(); - - char current_process_id_as_string[64] = {0}; - RTIOsapiUtility_snprintf( - current_process_id_as_string, - 64, - "%llu", - RTIOsapiProcess_getId()); - dds::sub::LoanedSamples< - dds::topic::ParticipantBuiltinTopicData>::iterator sample_it = - samples.begin(); - const std::string property_key(PROPERTY_NAME_DDS_SYS_INFO_PROCESS_ID); - for (; sample_it != samples.end(); ++sample_it) { - if (sample_it->info().valid() - && sample_it->info().state().instance_state() - == dds::sub::status::InstanceState::alive() - && sample_it->info().state().view_state() - == dds::sub::status::ViewState::new_view()) { - /* - * Juanlu: if we don't check the existence of the property first - * then the get() method will throw, printing the message: - * on_data_available:!property does not exist - */ - if (sample_it->data()->property().exists(property_key)) { - std::string process_property = - sample_it->data()->property().get(property_key); - if (!process_property.empty() - && process_property != current_process_id_as_string) { - dds::domain::ignore( - local_participant, - sample_it->info().instance_handle()); - } - } else { - /* Participants that do not contain this property are not - * part of the test */ - dds::domain::ignore( - local_participant, - sample_it->info().instance_handle()); - } - } - } - } -}; - -/** - * Utility class wrapping random number generation. Currently based on std::rand - * and a seed, that is output to a file on error. This allows for repeatability - * of the execution. - * The seed used to execute will be stored in a file called .seed, in the - * current working directory. This file will be looked for upon construction and - * if present, the value of the seed will be used as a seed to the std::rand - * function. - * Manually delete the .seed file if you want to resume non-repeatable - * execution. - * In the future, when we integrate with newer C++ standards, explore the - * possiblity of using std::random_device instead. - */ -class RandGenerator { -public: - - static const std::string& seed_file_name() - { - static std::string SEED_FILE_NAME_STR(".seed"); - return SEED_FILE_NAME_STR; - } - - RandGenerator(bool print_seed = true) : seed_(0), error_(true) - { - seed_ = std::chrono::time_point_cast( - std::chrono::high_resolution_clock::now()). - time_since_epoch().count() % rti::core::nanosec_per_sec; - - rti::apputils::util::Path seed_file(seed_file_name()); - if (seed_file.exists()) { - std::ifstream seed_f_stream((const char *) seed_file); - seed_f_stream >> seed_; - } - RTIOsapiUtility_srandWithSeed(seed_); - - if (print_seed) { - RTITestLog_freeForm( - RTI_LOG_BIT_EXCEPTION, - "Random generator seed for the test: %lu\n", - static_cast(seed_)); - } - } - - ~RandGenerator() - { - rti::apputils::util::Path seed_file(seed_file_name()); - if (!seed_file.exists()) { - if (error_) { - std::ofstream seed_f_stream((const char *) seed_file); - seed_f_stream << seed_; - seed_f_stream.close(); - } - } - } - - int32_t next(int32_t max) { - int32_t random = RTIOsapiUtility_rand(); - return random % max; - } - - int32_t next(int32_t min, int32_t max) { - int32_t random = RTIOsapiUtility_rand(); - return min + random % (max - min + 1); - } - - void set_error(bool error) - { - error_ = error; - } - -private: - - uint32_t seed_; - - bool error_; - -}; - -/** - * Utility class designed to make sure that we remove test files after a test is - * executed. This substitutes the old pattern using explicit calls to - * RTIOsapiFile_remove() at the end of the test, that are not reached when the - * test exits abnormally (fails). - * - * This class is supposed to be used with the following pattern: - * 1) Create the TestFileSet object at the beginning of the test. - * 2) Add the files and directories for which we want to link destruction to the - * destruction of the object itself. - * 3) Add a call to set_remove(true). If this call is added at the end of the - * test code, then if the test fails no files are deleted. This allows for - * inspection to determine the cause of the error. If added at any other - * point in the code, the files and directories will be deleted even if any - * test code after that point fails. - * We generally add calls to set_remove(true) when - */ -class TestFileSet { -public: - - TestFileSet() : remove_(false) - { - } - - ~TestFileSet() - { - if (remove_) { - std::list::iterator it = files_.begin(); - for (; it != files_.end(); it++) { - if (it->exists()) { - if (!RTIOsapiFile_remove(*it)) { - RTITestLog_freeForm( - RTI_LOG_BIT_WARN, - "Error removing file %s\n", - it->c_str());} - } - } - it = directories_.begin(); - for (; it != directories_.end(); it++) { - if (it->exists()) { - try { - rti::apputils::util::Path::remove_directory(*it); - } catch (std::exception& ex) { - RTITestLog_freeForm( - RTI_LOG_BIT_WARN, - "Error removing directory %s; exception = %s\n", - it->c_str(), - ex.what()); - } - } - } - } - } - - /** - * @brief Add a file path to the list of tracked files to be removed after - * completing the test. If the file already existed, it will be removed. - * This allows running tests with retries. - * - * Note: this method should be called before the file is actually created by - * the test, otherwise the file will be deleted automatically because of the - * desired behaviour above. - */ - void add_file(const rti::apputils::util::Path& file) - { - if (file.exists()) { - RTI_TEST_ASSERT(RTIOsapiFile_remove(file)); - } - files_.push_back(file); - } - - /** - * @brief Add a directory path to the list of tracked directories to be - * removed after completing the test. If the directory already existed, it - * will be removed. This allows running the tests with retries. - * - * Important notes: - * - when adding directories and one contains the other or - * others, add the deeper directories first. - * - this method should be called before the directory is actually created - * by the test, otherwise the directory will be deleted automatically - * because of the desired behaviour above. - */ - void add_directory(const rti::apputils::util::Path& directory) - { - if (directory.exists()) { - rti::apputils::util::Path::remove_directory(directory); - } - directories_.push_back(directory); - } - - /** - * @brief Set or unset the boolean flag controlling the deletion of - * directories and files associated with this TestFileSet. - * - * @param remove The value of the remove flag. This flag is false when the - * TestFileSet object is created. Setting it to true will - * enable automatic deletion of the associated directories and - * files. - */ - void set_remove(bool remove) - { - remove_ = remove; - } - -private: - - std::list files_; - std::list directories_; - bool remove_; -}; - -#define TEST_TYPES_FILE_NAME "RecorderServiceTestTypes.xml" - -/** - * A singleton abstraction that generates a new directory (in most platforms, - * inside the OS's temporary directory) for the tests to create by-products - * during their execution. - * If the tests pass, the directory will be deleted before the instance is - * destroyed. - */ -class TestWorkspaceProvider { -public: - - static TestWorkspaceProvider& init(RTITestSetting& setting) - { - static TestWorkspaceProvider singleton_(setting); - return singleton_; - } - - static const std::string& get() - { - /* - * The recording service tests generate byproducts in the form of - * database files. This can be problematic when running, for example, - * the tester application from the same tree, at the same time. We're - * going to provide a mechanism here where all the by-product files will - * be created inside a temporary working directory. We'll modify all the - * test configurations so that they define filenames based on an - * environment variable defining a directory that will be unique per - * execution. - */ - static std::string WORKSPACE_DIR; - if (WORKSPACE_DIR.empty()) { - #ifdef RTI_WIN32 - std::string placeholder; - #include "windows.h" - char placeholder_str[MAX_PATH]; - RTINtpTime now; - RTIOsapiUtility_getTime(&now); - DDS_Duration_t duration; - DDS_Duration_from_ntp_time(&duration, &now); - dds::core::Duration cpp_duration(duration.sec, duration.nanosec); - char temp_path[MAX_PATH]; - // Get the temporary directory - uint32_t size = GetTempPath(MAX_PATH, temp_path); - RTI_TEST_ASSERT(size <= MAX_PATH && size != 0); - placeholder.append(temp_path); - placeholder.append("Recorder4Tester_"); - std::ostringstream int_str; - int_str << cpp_duration.to_millisecs(); - placeholder.append(int_str.str()); - RTI_TEST_ASSERT(CreateDirectory(placeholder.c_str(), NULL)); - RTI_TEST_ASSERT(RTIOsapiUtility_normalizePath( - placeholder_str, - MAX_PATH, - placeholder.c_str())); - WORKSPACE_DIR.append(placeholder_str); - #elif defined RTI_QNX - #include - /* - * Because we must use the NFS until we have local memory in place, - * we need the full path of the current directory. To get it, we - * use the getcwd function. The max_path_size is set to 1024, as - * the QNX documentation says: www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.user_guide/topic/limits_NFS2.html - * The tmpl_size variable sets the maximum size of the temporary - * directory string. Given that the template of the path requires - * 37 characters, we must save 38 characters from the max size - * to append the temporary directory. - */ - const int tmplt_size = 38; - int max_path_size = 1024; - char tmpdir[] = "/recorder_tmp/"; - char tmplt[] = "Recorder4Tester_XXXXXXX"; - char current_dir[max_path_size-tmplt_size]; - char tmplt_full_path[max_path_size]=""; - char *tmp_dirname; - getcwd(current_dir,max_path_size-tmplt_size); - RTI_TEST_ASSERT(current_dir != NULL); - strcat(tmplt_full_path,current_dir); - strcat(tmplt_full_path,tmpdir); - mkdir(tmplt_full_path, S_IRWXU | S_IRWXG | S_IRWXO); - RTI_TEST_ASSERT(tmplt_full_path != NULL); - strcat(tmplt_full_path,tmplt); - tmp_dirname = mkdtemp(tmplt_full_path); - RTI_TEST_ASSERT(tmp_dirname != NULL); - WORKSPACE_DIR.append(tmp_dirname); - #else - #include - char tmplt[] = "/tmp/Recorder4Tester_XXXXXX"; - char *tmp_dirname = mkdtemp(tmplt); - RTI_TEST_ASSERT(tmp_dirname != NULL); - WORKSPACE_DIR.append(tmp_dirname); - #endif - } - return WORKSPACE_DIR; - } - - static const std::string& resource_path_var_name() - { - static const std::string RESOURCE_PATH_VAR_NAME( - "RTI_RECORDING_RESOURCE_DIR"); - return RESOURCE_PATH_VAR_NAME; - } - - static const std::string& working_dir_var_name() - { - static const std::string WORKING_DIR_VAR_NAME( - "RTI_RECORDING_WORKING_DIR"); - return WORKING_DIR_VAR_NAME; - } - - static const std::string& exec_dir_var_name() - { - static const std::string EXEC_DIR_VAR_NAME("RTI_RECORDING_EXEC_DIR"); - return EXEC_DIR_VAR_NAME; - } - - static const std::string& file_expr_var_name() - { - static const std::string FILE_EXPR_VAR_NAME("RTI_RECORDING_FILE_EXPR"); - return FILE_EXPR_VAR_NAME; - } - - static const std::string& monitoring_enabled_var_name() - { - static const std::string MONITORING_ENABLED_VAR_NAME( - "RTI_RECORDING_MONITORING"); - return MONITORING_ENABLED_VAR_NAME; - } - - static const std::string& monitoring_domain_id_var_name() - { - static const std::string MONITORING_DOMAIN_ID_VAR_NAME( - "RTI_RECORDING_MONITORING_DOMAIN_ID"); - return MONITORING_DOMAIN_ID_VAR_NAME; - } - - static const std::string& rollover_enabled_var_name() - { - static const std::string ROLLOVER_VAR_NAME( - "RTI_RECORDING_ROLLOVER_ENABLED"); - return ROLLOVER_VAR_NAME; - } - - static const std::string& storage_format_var_name() - { - static const std::string STORAGE_FORMAT_VAR_NAME( - "RTI_RECORDING_STORAGE_FORMAT"); - return STORAGE_FORMAT_VAR_NAME; - } - - static const std::string& out_storage_format_var_name() - { - static const std::string OUT_STORAGE_FORMAT_VAR_NAME( - "RTI_RECORDING_OUT_STORAGE_FORMAT"); - return OUT_STORAGE_FORMAT_VAR_NAME; - } - - static const std::string& cdr_representation_var_name() - { - static const std::string CDR_REPRESENTATION_VAR_NAME( - "RTI_RECORDING_CDR_REPRESENTATION"); - return CDR_REPRESENTATION_VAR_NAME; - } - - static const std::string& overwrite_policy_var_name() - { - static const std::string OVERWRITE_POLICY_VAR_NAME( - "RTI_RECORDING_OVERWRITE_POLICY"); - return OVERWRITE_POLICY_VAR_NAME; - } - - static const std::string& instance_indexing_kind_var_name() - { - static const std::string INSTANCE_INDEXING_VAR_NAME( - "RTI_RECORDING_INSTANCE_INDEX_TIMESTAMP_KIND"); - return INSTANCE_INDEXING_VAR_NAME; - } - - static const std::string& instance_indexing_enabled_var_name() - { - static const std::string INSTANCE_INDEXING_ENABLED_VAR_NAME( - "RTI_RECORDING_INSTANCE_INDEX_ENABLED"); - return INSTANCE_INDEXING_ENABLED_VAR_NAME; - } - - static const std::string& range_start_sec_var_name() - { - static const std::string RANGE_START_SEC_VAR_NAME( - "RTI_RECORDING_RANGE_START_SEC"); - return RANGE_START_SEC_VAR_NAME; - } - - static const std::string& range_start_nanosec_var_name() - { - static const std::string RANGE_START_NANOSEC_VAR_NAME( - "RTI_RECORDING_RANGE_START_NANOSEC"); - return RANGE_START_NANOSEC_VAR_NAME; - } - - static const std::string& range_end_sec_var_name() - { - static const std::string RANGE_END_SEC_VAR_NAME( - "RTI_RECORDING_RANGE_END_SEC"); - return RANGE_END_SEC_VAR_NAME; - } - - static const std::string& range_end_nanosec_var_name() - { - static const std::string RANGE_END_NANOSEC_VAR_NAME( - "RTI_RECORDING_RANGE_END_NANOSEC"); - return RANGE_END_NANOSEC_VAR_NAME; - } - - static const std::string& playback_sample_order_var_name() - { - static const std::string PLAYBACK_SAMPLE_ORDER( - "RTI_RECORDING_PLAYBACK_SAMPLE_ORDER"); - return PLAYBACK_SAMPLE_ORDER; - } - - static const std::string& playback_slice_period_sec_var_name() - { - static const std::string PLAYBACK_SLICE_PERIOD_SEC( - "RTI_RECORDING_PLAYBACK_SLICE_PERIOD_SEC"); - return PLAYBACK_SLICE_PERIOD_SEC; - } - - static const std::string& playback_slice_period_nanosec_var_name() - { - static const std::string PLAYBACK_SLICE_PERIOD_NANOSEC( - "RTI_RECORDING_PLAYBACK_SLICE_PERIOD_NANOSEC"); - return PLAYBACK_SLICE_PERIOD_NANOSEC; - } - - static const std::string& looping_enabled_var_name() - { - static const std::string LOOPING("RTI_RECORDING_LOOPING"); - return LOOPING; - } - - static const std::string& debug_mode_enabled_var_name() - { - static const std::string DEBUG_MODE("RTI_RECORDING_DEBUG_MODE"); - return DEBUG_MODE; - } - - - static const std::string& allow_topic_filter_var_name() - { - static const std::string ALLOW_TOPIC_FILTER_VAR_NAME( - "RTI_RECORDING_ALLOW_TOPIC_FILTER"); - return ALLOW_TOPIC_FILTER_VAR_NAME; - } - - static const std::string& deny_topic_filter_var_name() - { - static const std::string DENY_TOPIC_FILTER_VAR_NAME( - "RTI_RECORDING_DENY_TOPIC_FILTER"); - return DENY_TOPIC_FILTER_VAR_NAME; - } - - static const std::string& input_sql_init_var_name() - { - static const std::string INPUT_SQL_INIT_VAR_NAME( - "RTI_RECORDING_INPUT_SQL_INIT"); - return INPUT_SQL_INIT_VAR_NAME; - } - - static const std::string& output_sql_init_var_name() - { - static const std::string OUTPUT_SQL_INIT_VAR_NAME( - "RTI_RECORDING_OUTPUT_SQL_INIT"); - return OUTPUT_SQL_INIT_VAR_NAME; - } - - /** - * Copy a file into the current test workspace directory. - * - * @param origin Path to the original file to be copied. Can be relative or - * absolute. - * @param destination_relative The destination file, relative to the current - * test workspace directory. - */ - static void copy_file( - const std::string& origin, - const std::string& destination_relative) - { - rti::apputils::util::Path origin_path(origin); - rti::apputils::util::Path destination_abs_path(get()); - destination_abs_path += destination_relative; - origin_path.copy_to(destination_abs_path); - } - - /** - * Copy a file into the current working directory. - * - * @param origin Path to the origin file to be copied. - * @param destination_filename The name of the origin file in the current - * working directory after being copied. - */ -#if !defined(RTI_INTY) - static rti::apputils::util::Path copy_file_to_cwd( - const std::string& origin, - const std::string& destination_filename) - { - rti::apputils::util::Path destination( - rti::apputils::util::Path::cwd()); - destination += destination_filename; - rti::apputils::util::Path origin_path(origin); - origin_path.copy_to(destination); - return destination; - } -#endif - - static std::string go_to() - { -#ifdef RTI_WIN32 - char current_wd[MAX_PATH] = ""; - RTI_TEST_ASSERT(GetCurrentDirectory(MAX_PATH, current_wd)); - RTI_TEST_ASSERT(SetCurrentDirectory(get().c_str())); -#else - char current_wd[PATH_MAX] = ""; - RTI_TEST_ASSERT(getcwd(current_wd, sizeof(current_wd)) != NULL); - RTI_TEST_ASSERT(chdir(get().c_str()) == 0); -#endif - return std::string(current_wd); - } - - static void come_back(const std::string& current_working_dir) - { -#ifdef RTI_WIN32 - RTI_TEST_ASSERT(SetCurrentDirectory(current_working_dir.c_str())); -#else - RTI_TEST_ASSERT(chdir(current_working_dir.c_str()) == 0); -#endif - } - - void remove_dir(bool remove) - { - remove_dir_ = remove; - } - -private: - - bool remove_dir_; - - /** - * Initialize the environment variables needed in the XML files we load. - * They are necessary even if we're not using them directly in the - * configuration we're loading but are defined in the file. - * Note for Windows platforms: internally, the OSAPI function to set an - * environment variable uses putenv(). On Windows, this function will delete - * the environment variable if an empty string is passed as its value (the - * right side of the = expression). Thus, we cannot use an - * empty string for environment variables that are to be 'empty'. We're - * using a whitespace character instead. - */ - TestWorkspaceProvider(RTITestSetting& setting) : - remove_dir_(false) - { - /* Set resource path environment variable */ - char resource_path_c_str[RTI_TEST_MAX_FILE_NAME_LENGTH + 1] = ""; - RTI_TEST_ASSERT(RTITestSetting_getFullResourcePathFileName( - &setting, - resource_path_c_str, - "")); - rti::apputils::util::Path resource_path(resource_path_c_str); - RTITestLog_freeForm( - RTI_LOG_BIT_EXCEPTION, - "Working directory for the tests: %s\n", get().c_str()); - /* Copy the types XML file to the working directory */ - rti::apputils::util::Path types_file_path(resource_path); - types_file_path += "xml/" TEST_TYPES_FILE_NAME; - RTI_TEST_ASSERT(types_file_path.exists()); - copy_file(types_file_path, TEST_TYPES_FILE_NAME); - } - - ~TestWorkspaceProvider() - { - if (remove_dir_) { - rti::apputils::util::Path::remove_directory( - TestWorkspaceProvider::get()); - } - } -}; - -/** - * This class is used to change the current working directory to the test - * workspace. It ensures that when it gets out of scope, the app returns to the - * previous working directory. - */ -class TestDirectoryChangeGuard { -public: - - TestDirectoryChangeGuard() - { - cwd_ = TestWorkspaceProvider::go_to(); - } - - ~TestDirectoryChangeGuard() - { - TestWorkspaceProvider::come_back(cwd_); - } - -private: - - std::string cwd_; -}; - -/** - * Utility class designed to make sure that we remove test directory after a test is - * executed. This substitutes the old pattern using explicit calls to - * RTIOsapiFile_remove() at the end of the test, that are not reached when the - * test exits abnormally (fails) - */ -class TestScopedDirectory { -public: - - TestScopedDirectory() - { - } - - void set(const std::string& directory) - { - directory_ = directory; - } - - ~TestScopedDirectory() { - if (directory_.length() != 0) { - RTIOsapiUtility_deleteDirectory(directory_.c_str()); - } - } - -private: - std::string directory_; -}; - -/** - * A utility function to be used with shared pointers that hold pointers to - * arrays - */ -template -struct ArrayDeleter { - void operator ()(T *array) { - delete[] array; - } -}; - - -#define DEFAULT_TEST_TIMEOUT_SEC 60 - -// Common setup for many tests: participant, topic, reader, writer -// Uses QoS from AbstractDomainTester, but does not inherit, since the -// AbstractDomainTester doesn't provide virtual methods other than the -// destructor. -Package -class TestSystem { -public: - - typedef std::pair > > - Participant; - - TestSystem() - { - } - - // Uses the DomainParticipantQoS from AbstractDomainTester as a starting - // point (so we can pick up changes if that changes), and then adds - // additional QoS to test types with larger sized type code / type objects - static const dds::domain::qos::DomainParticipantQos& test_qos( - bool use_domain_tag = true) - { - using namespace dds::core; - /* - * [Juanlu]: we were originally providing no value for the boolean flag - * in the rti::test::AbstractDomainTester::test_qos() method below. - * This was causing us to use the low-memory generic built-in profile. - * The loading of a generic QoS profile causes our participants to lack - * the system info properties ('dds.sys_info.process_id', etc). - * When our extremely isolated participants detect the absence of this - * property in the participant properties, they ignore it. This was - * causing our tests to fail. - */ - static dds::domain::qos::DomainParticipantQos qos( - rti::test::AbstractDomainTester::test_qos(false)); - // override initial peers - StringSeq initial_peers_list; - initial_peers_list.push_back("8@localhost"); - initial_peers_list.push_back("8@udpv4://127.0.0.1"); - qos->discovery.initial_peers(initial_peers_list); - - StringSeq multicast_receive_addr_list; - qos->discovery.multicast_receive_addresses(multicast_receive_addr_list); - - qos->discovery.accept_unknown_peers(true); - - // Use UDPv4 only - qos->transport_builtin.mask( - rti::core::policy::TransportBuiltinMask::udpv4()); - - if (use_domain_tag) { - // Use our Domain Tag to ensure isolation of the tests - rti::core::policy::Property value; - value.set(rti::core::policy::Property::Entry( - domain_tag_property(), - domain_tag_value())); - qos << value; - } - - return qos; - } - - // Returmns default test writer qos - static const dds::pub::qos::DataWriterQos writer_qos() - { - using namespace dds::pub; - using namespace dds::core::policy; - using namespace rti::core::policy; - - dds::pub::qos::DataWriterQos qos; - make_transient_local(qos); - - return qos; - } - - // Returns default test reader qos - static const dds::sub::qos::DataReaderQos reader_qos() - { - using namespace dds::sub; - using namespace dds::core::policy; - using namespace rti::core::policy; - - dds::sub::qos::DataReaderQos qos; - make_transient_local(qos); - // set unbounded support - rti::core::policy::Property value; - value.set(rti::core::policy::Property::Entry( - reader_buffer_pool_property(), - buffer_pool_max_size())); - qos << value; - qos << DataReaderResourceLimits().dynamically_allocate_fragmented_samples( - true); - - return qos; - } - - static dds::sub::qos::DataReaderQos& make_xcdr2( - dds::sub::qos::DataReaderQos& qos) - { - using namespace dds::core::policy; - - DataRepresentationIdSeq data_vector; - data_vector.push_back(DataRepresentation::xcdr2()); - qos.policy().value( - data_vector.begin(), - data_vector.end()); - return qos; - } - - static dds::pub::qos::DataWriterQos& make_xcdr2( - dds::pub::qos::DataWriterQos& qos) - { - using namespace dds::core::policy; - - DataRepresentationIdSeq data_vector; - data_vector.push_back(DataRepresentation::xcdr2()); - qos.policy().value( - data_vector.begin(), - data_vector.end()); - return qos; - } - - // Create a DomainParticipant with QoS specific to Recording Service - static std::pair > > - create_participant( - int32_t domain_id, - const dds::domain::qos::DomainParticipantQos& qos = test_qos()) - { - dds::domain::qos::DomainParticipantFactoryQos factory_qos; - factory_qos << dds::core::policy::EntityFactory::ManuallyEnable(); - dds::domain::DomainParticipant::participant_factory_qos(factory_qos); - - dds::domain::DomainParticipant participant = - dds::domain::DomainParticipant(domain_id, qos); - - dds::sub::Subscriber builtin_subscriber = dds::sub::builtin_subscriber( - participant); - - // Access the built-in DataReader for ParticipantBuiltinTopicData - std::vector > participant_reader; - dds::sub::find< - dds::sub::DataReader >( - builtin_subscriber, - dds::topic::participant_topic_name(), - std::back_inserter(participant_reader)); - rti::core::ListenerBinder< - dds::sub::DataReader > - participant_listener = - rti::core::bind_and_manage_listener( - participant_reader[0], - new ParticipantBuiltinTopicListener, - dds::core::status::StatusMask::data_available()); - - participant.enable(); - - factory_qos << dds::core::policy::EntityFactory::AutoEnable(); - dds::domain::DomainParticipant::participant_factory_qos(factory_qos); - - return std::make_pair(participant, participant_listener); - } - - // Look up whether a Topic exists. If yes, return it. If not, create it - template - static dds::topic::Topic create_topic( - dds::domain::DomainParticipant& participant, - const std::string& topic_name = "Default") - { - dds::topic::Topic topic = - dds::topic::find >( - participant, - topic_name); - if (topic != dds::core::null) { - return topic; - } - return dds::topic::Topic(participant, topic_name); - } - - template - static dds::topic::Topic create_topic( - dds::domain::DomainParticipant& participant, - const std::string& topic_name, - const std::string& type_name) - { - dds::topic::Topic topic = - dds::topic::find >( - participant, - topic_name); - if (topic != dds::core::null) { - return topic; - } - return dds::topic::Topic(participant, topic_name, type_name); - } - - // Create a DataReader with transient local QoS - template - static dds::sub::DataReader create_transient_local_reader( - dds::domain::DomainParticipant& participant, - dds::topic::Topic& topic, - const bool unbounded = true, - const bool use_xcdr_2 = false) - { - using namespace dds::sub; - using namespace dds::core::policy; - using namespace rti::core::policy; - - qos::DataReaderQos qos; - make_transient_local(qos); - if (unbounded) { - rti::core::policy::Property value; - value.set(rti::core::policy::Property::Entry( - reader_buffer_pool_property(), - buffer_pool_max_size())); - qos << value; - qos << DataReaderResourceLimits().dynamically_allocate_fragmented_samples( - true); - } - if (use_xcdr_2) { - make_xcdr2(qos); - } - return dds::sub::DataReader(Subscriber(participant), topic, qos); - } - - // Create a DataReader with transient local QoS - template - static dds::sub::DataReader create_transient_local_reader( - dds::sub::Subscriber& subscriber, - dds::topic::Topic& topic, - const bool unbounded = true, - const bool use_xcdr_2 = false) - { - using namespace dds::sub; - using namespace dds::core::policy; - using namespace rti::core::policy; - - qos::DataReaderQos qos; - make_transient_local(qos); - if (unbounded) { - rti::core::policy::Property value; - value.set(rti::core::policy::Property::Entry( - reader_buffer_pool_property(), - buffer_pool_max_size())); - qos << value; - qos << DataReaderResourceLimits().dynamically_allocate_fragmented_samples( - true); - } - if (use_xcdr_2) { - make_xcdr2(qos); - } - return dds::sub::DataReader(subscriber, topic, qos); - } - - // Create a DataReader with transient local QoS - template - static dds::sub::DataReader create_transient_local_reader( - dds::domain::DomainParticipant& participant, - dds::topic::Topic& topic, - const dds::sub::qos::DataReaderQos& suggested_qos, - const bool unbounded = true, - const bool use_xcdr_2 = false) - { - using namespace dds::sub; - using namespace dds::core::policy; - using namespace rti::core::policy; - - qos::DataReaderQos qos(suggested_qos); - make_transient_local(qos); - if (unbounded) { - rti::core::policy::Property value; - value.set(rti::core::policy::Property::Entry( - reader_buffer_pool_property(), - buffer_pool_max_size())); - qos << value; - qos << DataReaderResourceLimits().dynamically_allocate_fragmented_samples( - true); - } - if (use_xcdr_2) { - make_xcdr2(qos); - } - return dds::sub::DataReader(Subscriber(participant), topic, qos); - } - - // Create a DataReader with specified qos - template - static dds::sub::DataReader create_reader( - dds::domain::DomainParticipant& participant, - dds::topic::Topic& topic, - dds::sub::qos::DataReaderQos& qos, - const std::string& filter_expression = "", - const bool use_xcdr_2 = false) - { - using namespace dds::sub; - - if (use_xcdr_2) { - make_xcdr2(qos); - } - dds::topic::TopicDescription topic_desc = topic; - if (filter_expression.length() != 0) { - // Create the ContentFilteredTopic - dds::topic::ContentFilteredTopic cft = - dds::topic::ContentFilteredTopic( - topic, // related topic - topic.name() + "CFT" + filter_expression, - dds::topic::Filter(filter_expression)); - return dds::sub::DataReader(Subscriber(participant), cft, qos); - } else { - return dds::sub::DataReader(Subscriber(participant), topic, qos); - } - } - - // Create a reliable DataReader with Recording-Service friendly buffer pool size - template - static dds::sub::DataReader create_reader( - dds::domain::DomainParticipant& participant, - dds::topic::Topic topic, - const bool unbounded = true, - const std::string& filter_expression = "", - const bool use_xcdr_2 = false) - { - using namespace dds::sub; - using namespace dds::core::policy; - using namespace rti::core::policy; - - qos::DataReaderQos qos; - if (unbounded) { - rti::core::policy::Property value; - value.set(rti::core::policy::Property::Entry( - reader_buffer_pool_property(), - buffer_pool_max_size())); - qos << value; - qos << DataReaderResourceLimits().dynamically_allocate_fragmented_samples( - true); - } - if (use_xcdr_2) { - make_xcdr2(qos); - } - return create_reader(participant, topic, qos, filter_expression); - } - - // Create a DataWriter with suggested QoS and make it transient local - template - static dds::pub::DataWriter create_transient_local_writer( - dds::domain::DomainParticipant& participant, - dds::topic::Topic& topic, - const dds::pub::qos::DataWriterQos& suggested_qos, - const bool use_xcdr_2 = false) - { - using namespace dds::pub; - - qos::DataWriterQos adjusted_qos(suggested_qos); - make_transient_local(adjusted_qos); - if (use_xcdr_2) { - make_xcdr2(adjusted_qos); - } - return dds::pub::DataWriter( - Publisher(participant), - topic, - adjusted_qos); - } - - // Create a DataWriter with suggested QoS and make it transient local, - // also including an already existing publisher - template - static dds::pub::DataWriter create_transient_local_writer( - dds::pub::Publisher& publisher, - dds::topic::Topic& topic, - dds::pub::qos::DataWriterQos& suggested_qos, - const bool use_xcdr_2 = false) - { - using namespace dds::pub; - - qos::DataWriterQos adjusted_qos(std::move(suggested_qos)); - make_transient_local(adjusted_qos); - if (use_xcdr_2) { - make_xcdr2(adjusted_qos); - } - return dds::pub::DataWriter( - publisher, - topic, - adjusted_qos); - } - - // Create a DataWriter with transient local QoS - template - static dds::pub::DataWriter create_transient_local_writer( - dds::domain::DomainParticipant& participant, - dds::topic::Topic topic, - const bool use_xcdr_2 = false) - { - dds::pub::qos::DataWriterQos qos; - return create_transient_local_writer( - participant, - topic, - qos, - use_xcdr_2); - } - - // Create a DataWriter with transient local QoS and external Publisher - template - static dds::pub::DataWriter create_transient_local_writer( - dds::pub::Publisher& publisher, - dds::topic::Topic topic, - const bool use_xcdr_2 = false) - { - dds::pub::qos::DataWriterQos qos; - return create_transient_local_writer(publisher, topic, qos, use_xcdr_2); - } - - // Create a DataWriter with transient local QoS - template - static dds::pub::DataWriter create_writer( - dds::domain::DomainParticipant& participant, - dds::topic::Topic& topic, - const bool use_xcdr_2 = false) - { - using namespace dds::pub; - - qos::DataWriterQos qos; - if (use_xcdr_2) { - make_xcdr2(qos); - } - return dds::pub::DataWriter(Publisher(participant), topic, qos); - } - - template - static bool wait_for_readers( - dds::pub::DataWriter& writer, - int32_t num_readers, - int32_t timeout_sec = DEFAULT_TEST_TIMEOUT_SEC) - { - try { - RTI_TEST_WAIT_FOR_EQUALS_INT( - num_readers, - writer.publication_matched_status().current_count(), - timeout_sec); - } catch (...) { - return false; - } - - return true; - } - - template - static bool wait_for_writers( - dds::sub::DataReader& reader, - int32_t num_writers, - int32_t timeout_sec = DEFAULT_TEST_TIMEOUT_SEC) - { - try { - RTI_TEST_WAIT_FOR_EQUALS_INT( - num_writers, - reader.subscription_matched_status().current_count(), - timeout_sec); - } catch (...) { - return false; - } - return true; - } - - template - static bool check_num_writers_invariant( - dds::sub::DataReader& reader, - int32_t num_writers, - int32_t for_seconds = DEFAULT_TEST_TIMEOUT_SEC) - { - const struct RTINtpTime sleepTime = {0,429496730}; - int sleeps = 0; - int32_t writer_current_count = - reader.subscription_matched_status().current_count(); - bool result = (num_writers == writer_current_count); - while(result && sleeps < (static_cast(for_seconds)) * 10) { - RTIOsapiThread_sleep(&sleepTime); - ++sleeps; - writer_current_count = - reader.subscription_matched_status().current_count(); - result = (num_writers == writer_current_count); - } - if (!result) { - print_assert_equals_failure(num_writers, writer_current_count); - } - return result; - } - - template - static bool wait_for_received_sample_state( - dds::sub::DataReader& reader, - int32_t received_total_count, - int32_t cache_sample_count, - int32_t timeout_sec = DEFAULT_TEST_TIMEOUT_SEC) - { - try { - RTI_TEST_WAIT_FOR_EQUALS_INT( - received_total_count, - reader->datareader_protocol_status().received_sample_count().total(), - timeout_sec); - RTI_TEST_WAIT_FOR_EQUALS_INT( - cache_sample_count, - reader->datareader_cache_status().sample_count(), - timeout_sec); - } catch (...) { - return false; - } - return true; - } - - template - static bool wait_for_read_count( - dds::sub::DataReader& reader, - int32_t read_count, - int32_t timeout_sec = DEFAULT_TEST_TIMEOUT_SEC) - { - try { - RTI_TEST_WAIT_FOR_EQUALS_INT( - read_count, - (int32_t) reader.read().length(), - timeout_sec); - } catch (...) { - return false; - } - return true; - } - - template - static bool wait_for_read_count( - typename dds::sub::DataReader::Selector selector, - int32_t read_count, - int32_t timeout_sec = DEFAULT_TEST_TIMEOUT_SEC) - { - try { - RTI_TEST_WAIT_FOR_EQUALS_INT( - read_count, - (int32_t) selector.read().length(), - timeout_sec); - } catch (...) { - return false; - } - return true; - } - - - template - static void wait_for_dispose( - typename dds::sub::DataReader reader, - const dds::core::InstanceHandle& handle, - int32_t timeout_sec = DEFAULT_TEST_TIMEOUT_SEC) - { - RTI_TEST_WAIT_FOR( - reader.select() - .state(dds::sub::status::InstanceState::not_alive_mask()) - .instance(handle).read().length() > 0, - timeout_sec); - } - - static const std::string domain_tag_property() - { - return PRES_PARTICIPANT_DOMAIN_TAG_PROPERTY_NAME; - } - - static const std::string domain_tag_value() - { - return "rti.recording.test.DOMAIN_TAG"; - } - -private: - - static dds::sub::qos::DataReaderQos& make_transient_local( - dds::sub::qos::DataReaderQos& qos) - { - using namespace dds::core::policy; - - qos.policy().kind(DurabilityKind::TRANSIENT_LOCAL); - qos.policy().kind(ReliabilityKind::RELIABLE); - qos.policy().kind(HistoryKind::KEEP_ALL); - - return qos; - } - - static dds::pub::qos::DataWriterQos& make_transient_local( - dds::pub::qos::DataWriterQos& qos) - { - using namespace dds::core::policy; - - qos.policy().kind(DurabilityKind::TRANSIENT_LOCAL); - qos.policy().kind(ReliabilityKind::RELIABLE); - qos.policy().kind(HistoryKind::KEEP_ALL); - qos << WriterDataLifecycle::ManuallyDisposeUnregisteredInstances(); - - return qos; - } - - // Note: The following constants are encapsulated in static methods rather - // than private constant static members to avoid creating a .cxx file just - // to initialize static constant variables. - - static const std::string buffer_pool_max_size() - { - return "16384"; - } - - static const std::string reader_buffer_pool_property() - { - return PROPERTY_NAME_DDS_DATA_READER_HISTORY_MEMORY_MANAGER_FAST_POOL_POOL_BUFFER_MAX_SIZE; - } - -}; - -} } } /* namespace rti::apputils::test */ - -#endif /* HPP_APPUTILS_FRAMEWORK_HPP_ */ -// -------------------------------------------------------------------- - -/* End $Id$ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestLogCapture.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestLogCapture.hpp deleted file mode 100644 index 0221546ab..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/test/TestLogCapture.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - (c) Copyright, Real-Time Innovations, 2023. - All rights reserved. - No duplications, whole or partial, manual or electronic, may be made - without express written permission. Any such copies, or - revisions thereof, must display this notice unaltered. - This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef HPP_APPUTILS_TEST_LOG_CAPTURE_HPP_ -#define HPP_APPUTILS_TEST_LOG_CAPTURE_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include - -#include "rtitest/test_setting.h" -#include "ddsctesthelpers/test_helper.h" - -namespace rti { namespace apputils { namespace test { - -/** - * @brief This class is a C++ wrapper for the APPUTILSTestUtils_LoggerDevice - * type, used to capture logs and find expected messages. - */ -class TestLogCapture { -public: - TestLogCapture(const std::string& expected_message) : - expected_message_(expected_message) - { - device_data_ = DDSCTesterHelperLoggerDeviceData_INITIALIZER(NULL); - if (!DDSCTesterHelperLoggerDeviceData_initialize(&device_data_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "logger device data"); - } - device_data_.expectedMessage = expected_message_.c_str(); - - if (!DDSCTesterHelper_cacheLoggingConfiguration()) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "cache logging configuration"); - } - - // Prepare the device logger for catching the expected message - logger_device_ = NDDS_Config_LoggerDevice_INITIALIZER; - logger_device_.device_data = &device_data_; - logger_device_.write = DDSCTesterHelper_loggerDeviceWrite; - - if (!NDDS_Config_Logger_set_output_device( - NDDS_Config_Logger_get_instance(), - &logger_device_)) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_INIT_FAILURE_s, - "set output device"); - } - } - - ~TestLogCapture() - { - DDSCTesterHelperLoggerDeviceData_finalize(&device_data_); - - // Restore the logging configuration; this will restore the previous - // output device if it was changed - if (!DDSCTesterHelper_restoreLoggingConfiguration()) { - RTITestLogger_log( - RTI_LOG_BIT_EXCEPTION, - &RTI_TEST_LOG_FAILURE_TEMPLATE, - "restore logging configuration"); - } - } - - unsigned int found_messages() const - { - return device_data_.foundMessages; - } - - -private: - - struct NDDS_Config_LoggerDevice logger_device_; - - struct DDSCTesterHelperLoggerDeviceData device_data_; - - std::string expected_message_; -}; - -} } } /* namespace rti::apputils::test */ - -#endif /* HPP_APPUTILS_TEST_LOG_CAPTURE_HPP_ */ -// -------------------------------------------------------------------- - -/* End $Id$ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/LockedBuffer.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/LockedBuffer.hpp deleted file mode 100644 index a278da2fe..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/LockedBuffer.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ -#ifndef HPP_APPUTILS_LOCKEDBUFFER_HPP_ -#define HPP_APPUTILS_LOCKEDBUFFER_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include "dds/core/types.hpp" - -namespace rti { namespace apputils { namespace util { - -/** - * A type-agnostic class that services as a locked, unmodifiable region in - * memory. This is handy to transport a data buffer from one code region to - * another without having to perform any copy operations. Producer of the buffer - * and consumer of the buffer know how to work with the raw data. - */ -class UntypedLockedBuffer { -public: - UntypedLockedBuffer() : buffer_(NULL), size_(0) {} - UntypedLockedBuffer(const void *buffer, const uint32_t size) : - buffer_(buffer), size_(size) {} - ~UntypedLockedBuffer() {} - - void set(const void *buffer, const uint32_t size) - { - buffer_ = buffer; - size_ = size; - } - - void reset() - { - buffer_ = NULL; - size_ = 0; - } - - uint32_t size() const { return size_; } - -protected: - - const void * buffer() const { return buffer_; } - -private: - const void *buffer_; - uint32_t size_; -}; - - -/** - * This class represents a locked, unmodifiable region in memory. This is handy - * to transport a data buffer from one code region to another without having to - * perform any copy operations. Producer of the buffer and consumer of the - * buffer know how to work with the raw data. - */ -template -class LockedBuffer : public UntypedLockedBuffer { -public: - LockedBuffer() : UntypedLockedBuffer() {} - LockedBuffer(const T *buffer, const uint32_t size) : - UntypedLockedBuffer(static_cast(buffer), size) {} - ~LockedBuffer() {} - - void set(const T *buffer, const uint32_t size) - { - UntypedLockedBuffer::set(static_cast(buffer), size); - } - - const T * buffer() const { - return static_cast(UntypedLockedBuffer::buffer()); - } -}; - -} } } // namespace rti::apputils::util - -#endif /* HPP_APPUTILS_LOCKEDBUFFER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Path.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Path.hpp deleted file mode 100644 index c252ef9a4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Path.hpp +++ /dev/null @@ -1,495 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2018. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_APPUTILS_PATH_HPP_ -#define HPP_APPUTILS_PATH_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#if defined(RTI_UNIX) || defined(RTI_QNX) - #include - #include -#endif - -#if defined(RTI_UNIX) || defined(RTI_QNX) - #if !defined(_XOPEN_SOURCE) && !defined(RTI_DARWIN) - #define _XOPEN_SOURCE 600 - #endif - #include - #include - #include - #include -#endif - -#ifdef RTI_WIN32 - #include -#endif - -#include "osapi/osapi_type.h" -#include "osapi/osapi_utility.h" - -#include -#include - -namespace rti { namespace apputils { namespace util { - -class Path { -public: - Path() - { } - - Path(const std::string& path) : path_string_(path) - { - path_string_ = remove_double_separators(path_string_); - path_string_ = remove_trailing_separators(path_string_); - } - - Path(const Path& path) : path_string_(path.path_string_) - { } - - operator const std::string &() const - { - return path_string_; - } - - operator const char *() const - { - return path_string_.c_str(); - } - - const char *c_str() const - { - return path_string_.c_str(); - } - - bool empty() const - { - return path_string_.empty(); - } - - void append(const std::string& fragment) - { - if (!path_string_.empty()) { - path_string_ += "/"; - } - path_string_ += fragment; - path_string_ = remove_double_separators(path_string_); - path_string_ = remove_trailing_separators(path_string_); - } - - void append(const Path& fragment) - { - append((const std::string&) fragment); - } - - void operator+=(const std::string& fragment) - { - append(fragment); - } - - void operator+=(const Path& fragment) - { - append((const std::string&) fragment); - } - - Path operator+(const std::string& other) const - { - Path path(*this); - path.append(other); - return path; - } - - Path operator+(const Path& other) const - { - Path path(*this); - path.append(other); - return path; - } - - int compare(const Path& other) - { - return path_string_.compare((const std::string&) other); - } - - int compare(const std::string& other) - { - return path_string_.compare(other); - } - - int compare(const char *other) - { - return path_string_.compare(other); - } - - /** - * Path is interpreted as a file. Return whether the file exists or not. - */ - bool exists() const - { - // Check if the path is a file and if it exists - if (RTIOsapiFile_exists(path_string_.c_str()) == RTI_TRUE) { - return true; - } else { -#if defined(RTI_UNIX) || defined(RTI_QNX) - // Otherwise check if it's a directory and if it exists - struct stat info; - if (stat(path_string_.c_str(), &info) == 0 - && S_ISDIR(info.st_mode)) { - return true; - } else { - return false; - } -#elif defined(RTI_WIN32) - #ifndef S_ISDIR - #define S_ISDIR(mode) (((mode) &_S_IFMT) == _S_IFDIR) - #endif - // Otherwise check if it's a directory and if it exists - struct _stat info; - if (_stat(path_string_.c_str(), &info) == 0 - && S_ISDIR(info.st_mode)) { - return true; - } else { - return false; - } -#endif - } - } - - static void create_directory(const Path& path) - { -#if defined(RTI_UNIX) || defined(RTI_QNX) - errno = 0; - if (mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0 - && (errno != EEXIST)) { - std::stringstream error_msg; - error_msg << "!create directory: " << path << "\n" - << "CreateDirectory() error code: " << errno << "\n"; - throw dds::core::IllegalOperationError(error_msg.str()); - } -#elif defined(RTI_WIN32) - if (!CreateDirectory(path, NULL)) { - DWORD last_error = GetLastError(); - if (last_error != ERROR_ALREADY_EXISTS) { - std::stringstream error_msg; - error_msg << "!create directory: " << path << "\n" - << "CreateDirectory() error code: " << last_error - << "\n"; - throw dds::core::IllegalOperationError(error_msg.str()); - } - } -#else - throw dds::core::IllegalOperationError("unsupported"); -#endif - } - - /** - * Interpreting the path as a directory, create any non-existing directories - * in the path. - */ - void create_directory() - { - // If the path is a file, and it exists, exit - if (exists()) { - return; - } - // Get splits, build a - std::vector splits = split(); - Path aux; - for (std::vector::iterator split_it = splits.begin(); - split_it != splits.end(); - split_it++) { - aux += *split_it; - if (!aux.exists()) { - create_directory(aux); - } - } - } - - static void remove_directory(const Path& path) - { -#if defined(RTI_UNIX) || defined(RTI_QNX) - errno = 0; - if (nftw(path, remove_file, 20, FTW_DEPTH) == -1) { - if (errno != ENOENT) { - perror("nftw"); - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_FAILURE_s, - "remove_directory() error"); - } - } -#else - if (!RTIOsapiFile_removeFileOrDirectory(path.c_str())) { - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_ANY_ss, - "Failed to delete directory: ", - path.c_str()); - } -#endif - } - - void copy_to(const Path& destination_path) - { - if (!exists()) { - return; - } - try { - std::ifstream src(path_string_.c_str(), std::ios::binary); - std::ofstream dst( - destination_path.path_string_.c_str(), - std::ios::binary); - dst << src.rdbuf(); - } catch (std::exception& ex) { - std::stringstream stream; - stream << "Failed to copy file" << std::endl; - stream << " origin : " << path_string_ << std::endl; - stream << " destination: " << destination_path << std::endl; - stream << " error message: " << ex.what() << std::endl; - DDSLog_exception(&RTI_LOG_ANY_s, stream.str().c_str()); - } - } - - void append_extension(const std::string& extension) - { - path_string_ += extension; - } - - /** - * This method detects and returns a (last) "." in the last split of a - * string. The substring after this dot is considered to be the file - * extension. - */ - std::string detect_file_extension() - { - std::string file_extension; - std::vector splits = split(); - std::string last_split = splits[splits.size() - 1]; - std::string::size_type pos = last_split.find_last_of('.'); - if (pos != std::string::npos) { - file_extension = last_split.substr(pos + 1); - } - return file_extension; - } - - /** - * This method returns the file name (the last split in the path). Depending - * on the parameter, it will strip out the file extension or not. - */ - std::string detect_file_name(bool include_extension = true) const - { - std::vector splits = split(); - std::string last_split = splits[splits.size() - 1]; - if (!include_extension) { - std::string::size_type pos = last_split.find_last_of('.'); - if (pos != std::string::npos) { - return last_split.substr(0, pos); - } - } - return last_split; - } - - std::vector split() const - { - std::vector splits; - std::istringstream stream(path_string_); - std::string string_split; - bool prepend_separator = false; - while (getline(stream, string_split, '/')) { - if (string_split.empty()) { - // This can happen if the path is absolute (starts with a - // separator). The first split should contain that separator. - // Signal this with a boolean variable - prepend_separator = true; - continue; - } - if (prepend_separator) { - splits.push_back("/" + string_split); - prepend_separator = false; - } else { - splits.push_back(string_split); - } - } - return splits; - } - - static Path from_splits(const std::vector& splits) - { - Path path; - for (size_t i = 0; i < splits.size(); i++) { - path += splits[i]; - } - return path; - } - - uint64_t file_size() const - { -#ifdef RTI_WIN32 - HANDLE file_handle = CreateFile( - path_string_.c_str(), - GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - if (file_handle == INVALID_HANDLE_VALUE) { - DDSLog_warn( - &RTI_LOG_ANY_ss, - "Failed to get file size for file: ", - path_string_.c_str()); - return 0; - } - LARGE_INTEGER size; - if (!GetFileSizeEx(file_handle, &size)) { - CloseHandle(file_handle); - DDSLog_warn( - &RTI_LOG_ANY_ss, - "Failed to get file size for file: ", - path_string_.c_str()); - return 0; - } - CloseHandle(file_handle); - return size.QuadPart; -#else - struct stat buffer; - if (stat(path_string_.c_str(), &buffer) != 0) { - DDSLog_warn( - &RTI_LOG_ANY_ss, - "Failed to get file size for file: ", - path_string_.c_str()); - return 0; - } - return (uint64_t) buffer.st_size; -#endif - } - -#if !defined(RTI_INTY) - /* - * CORE-10727 [Antonio L]: - * cwd() is not supported in all the architectures. We have to - * port it. - */ - static Path cwd() - { - char working_directory[RTI_OSAPI_STRING_SEQ_STRING_MAX_SIZE] = { 0 }; - bool no_error = false; - - no_error = - (RTIOsapiUtility_getCurrentDirectory( - working_directory, - RTI_OSAPI_STRING_SEQ_STRING_MAX_SIZE) - != NULL); - if (!no_error) { - int errnum = RTIOsapiUtility_getError(); - char error_string[RTI_OSAPI_ERROR_STRING_MAX_SIZE] = { 0 }; - RTI_THROW_SERVICE_EXCEPTION( - &RTI_LOG_OS_FAILURE_sXs, - "getcwd", - errnum, - RTIOsapiUtility_getErrorString( - error_string, - RTI_OSAPI_ERROR_STRING_MAX_SIZE, - errnum)); - } - return Path(working_directory); - } -#endif - -private: - std::string path_string_; - -#define SEPARATOR_STR "/" - - /** - * Converter Windows-style separators into Unix-style ones - */ - std::string normalize(const std::string& path) - { - std::string normalized(path); - const std::string SEPARATOR(SEPARATOR_STR); - std::string::size_type pos = normalized.find_first_of('\\'); - while (pos != std::string::npos) { - normalized = normalized.replace(pos, 1, SEPARATOR); - pos = normalized.find_first_of('\\', pos + 1); - } - return normalized; - } - - std::string remove_trailing_separators(const std::string& path) - { - std::string modified(normalize(path)); - if (!modified.empty() && modified.at(modified.size() - 1) == '/') { - modified.erase(modified.size() - 1); - } - return modified; - } - - std::string remove_double_separators(std::string& path) - { - const std::string DOUBLE_SEPARATOR_STR("//"); - std::string modified(normalize(path)); - std::string::size_type pos = modified.find(DOUBLE_SEPARATOR_STR); - while (pos != std::string::npos) { - modified = modified.replace( - pos, - DOUBLE_SEPARATOR_STR.size(), - SEPARATOR_STR); - pos = modified.find(DOUBLE_SEPARATOR_STR, pos + 1); - } - return modified; - } - - static int remove_file( - const char *fpath, - const struct stat *sb, - int tflag, - struct FTW *ftwbuf) - { - RTIOsapiUtility_unusedParameter(sb); - RTIOsapiUtility_unusedParameter(tflag); - RTIOsapiUtility_unusedParameter(ftwbuf); - -#ifdef RTI_QNX - /** - * In QNX we create the working directory in the NFS. Because the NFS - * have important delays, if we try to remove all the directories, - * the remove will fail because the NFS will accept the request to - * remove the files, but they won't be removed once we reach the upper - * level. Therefore, we will not remove the directories of the QNX - * testers - */ - struct stat buf; - int err = stat(fpath, &buf); - errno = 0; - if (err == 0 && (buf.st_mode & _S_IFMT) != S_IFDIR) - errno = remove(fpath); - return errno; -#else - return remove(fpath); -#endif - } -}; - -}}} // namespace rti::apputils::util - -#endif /* HPP_APPUTILS_PATH_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Utils.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Utils.hpp deleted file mode 100644 index a4fa5cc98..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/Utils.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef APPUTILS_HPP_ -#define APPUTILS_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include -#include -#include -#include -#include - -#include "osapi/osapi_utility.h" -#include - -#include -#include "dds/core/Time.hpp" - - -#define STATIC_CONST_STRING_DEFINITION(classname, name, value) \ -const std::string& classname::name() \ -{ \ - static std::string name##var(value); \ - return name##var; \ -} - -#define RECORDER_FILE_PATH_MAX_LENGTH (4096) - -namespace rti { namespace apputils { namespace util { - -constexpr int64_t g_int64_max = 0x7FFFFFFFFFFFFFFFULL; -constexpr uint64_t g_uint64_max = 0xFFFFFFFFFFFFFFFFULL; - -inline -std::string normalize_path(const std::string& file_name) -{ - char normalized[RECORDER_FILE_PATH_MAX_LENGTH] = {'\0'}; - if (!RTIOsapiUtility_normalizePath( - normalized, - RECORDER_FILE_PATH_MAX_LENGTH, - file_name.c_str())) { - std::stringstream error_msg; - error_msg << "!normalize path " << file_name.c_str() << "\n"; - throw dds::core::IllegalOperationError(error_msg.str()); - } - - return normalized; -} - -inline -int64_t convert_uint64_into_int64(uint64_t value) -{ - int64_t signed_int64 = 0; - if (value > g_int64_max) { - signed_int64 = g_int64_max; - } else { - signed_int64 = (int64_t) value; - } - - return signed_int64; -} - -inline -uint64_t to_nanosecs(dds::core::Time time) -{ - uint64_t nanosec; - try { - nanosec = time.to_nanosecs(); - } catch (std::overflow_error&) { - nanosec = g_uint64_max; - } - - return nanosec; -} - -/** - * @brief Check if the sum of two values would produce an overflow. - * - * @tparam T type of the elements to be summed. - * - * @param lhs Left-hand side of the sum - * @param rhs Right-hand side of the sum - * - * @return true if the sum overflows, false otherwise. - */ -template -bool sum_overflows(T lhs, T rhs) -{ - return lhs > 0 && rhs > 0 && (std::numeric_limits::max)() - lhs < rhs; -} - -/** - * @brief Check if the sum of two values would produce an underflow. - * - * @tparam T type of the elements to be summed. - * - * @param lhs Left-hand side of the sum - * @param rhs Right-hand side of the sum - * - * @return true if the sum underflows, false otherwise. - */ -template -bool sum_underflows(T lhs, T rhs) -{ - return lhs < 0 && rhs < 0 && std::numeric_limits::lowest() - lhs > rhs; -} - -} } } // namespace rti:apputils::util - -#endif /* APPUTILS_HPP_ */ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/VersionableComponent.hpp b/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/VersionableComponent.hpp deleted file mode 100644 index c0d3b6502..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/apputils/util/VersionableComponent.hpp +++ /dev/null @@ -1,155 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ -#ifndef HPP_RTI_APPUTILS_VERSIONABLECOMPONENT_HPP_ -#define HPP_RTI_APPUTILS_VERSIONABLECOMPONENT_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include -#include - -#include -#include "dds/core/Exception.hpp" - -namespace rti { namespace apputils { namespace util { - -class ComponentVersion { -public: - constexpr ComponentVersion() noexcept : - major_(0), - minor_(0) - { } - - constexpr ComponentVersion(const uint8_t major, const uint8_t minor) noexcept : - major_(major), - minor_(minor) - { } - - ComponentVersion(const std::string& version_str) - { - std::istringstream stream(version_str); - int16_t value; - - stream >> value; - if (stream.fail()) { - throw dds::core::InvalidArgumentError(version_string_error(version_str)); - } - major_ = static_cast(value); - - char separator; - stream >> separator; - if (stream.fail() || separator != '.') { - throw dds::core::InvalidArgumentError(version_string_error(version_str)); - } - - stream >> value; - if (stream.fail()) { - throw dds::core::InvalidArgumentError(version_string_error(version_str)); - } - minor_ = static_cast(value); - } - - uint8_t get_major() const noexcept { return major_; } - uint8_t get_minor() const noexcept { return minor_; } - - bool operator ==(const ComponentVersion& other) const noexcept - { - return (major_ == other.major_ && minor_ == other.minor_); - } - - bool operator !=(const ComponentVersion& other) const noexcept - { - return !(*this == other); - } - - bool operator < (const ComponentVersion& other) const noexcept - { - if ((int16_t) major_ - (int16_t) other.major_ == 0) { - return ((int16_t) minor_ - (int16_t) other.minor_ < 0); - } else { - return ((int16_t) major_ - (int16_t) other.major_ < 0); - } - } - - bool operator > (const ComponentVersion& other) const noexcept - { - if ((int16_t) major_ - (int16_t) other.major_ == 0) { - return ((int16_t) minor_ - (int16_t) other.minor_ > 0); - } else { - return ((int16_t) major_ - (int16_t) other.major_ > 0); - } - } - - operator std::string () const noexcept - { - return std::to_string(major_) + "." + std::to_string(minor_); - } - -private: - uint8_t major_; - uint8_t minor_; - - std::string version_string_error (const std::string & str) const noexcept - { - return "VersionableComponent: invalid version string: " + str; - } -}; - -/** - * @brief A versionable component has a name and a version and it's used to - * keep track of the versions of the components used to record data. - * This information is kept in the 'metadata' database file. It can later - * be recovered by Replay/Converter to use exactly the same components' - * versions that were when recording. - * @param VersionType The version object to be used. By default, the Version - * type implemented above is used (a simple, two-digit, stringifyable - * version type). - */ -template -class VersionableComponent { -public: - - VersionableComponent( - std::string component_name, - const VersionType& version) : - component_name_(component_name), - version_(version) { } - - const VersionType& version() const { return version_; } - - const std::string& component_name() const { return component_name_; } - - void verify_version(const VersionType& version) const - { - if (version > version_) { - std::stringstream error_stream; - error_stream << "VersionableComponent: " << component_name_.c_str() - << ": detected newer version. The current version of the " - << "component in this tool (" - << ((const std::string&) version_).c_str() - << ") is unable to read the newer " - << component_name_.c_str() <<" version (" - << ((const std::string&) version).c_str() <<") found "; - throw dds::core::IllegalOperationError(error_stream.str()); - } - } - -private: - std::string component_name_; - VersionType version_; -}; - -typedef VersionableComponent DefaultVersionableComponent; - -} } } /* namespace rti::apputils::util */ - -#endif /* HPP_RTI_APPUTILS_VERSIONABLECOMPONENT_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/cds/Logger.hpp b/qt6-after/qt6-migrated-legatus/include/rti/cds/Logger.hpp deleted file mode 100644 index d8060fc02..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/cds/Logger.hpp +++ /dev/null @@ -1,223 +0,0 @@ -/** - * (c) Copyright, Real-Time Innovations, 2020. All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_CDS_LOGGER_HPP_ -#define RTI_CDS_LOGGER_HPP_ - -#include -#include - -#include "clouddiscoveryservice/clouddiscoveryservice_service.h" -#include "clouddiscoveryservice/clouddiscoveryservice_log.h" - -namespace rti { namespace cds { - -/** \defgroup RTI_CDS_Logger Logging - * - * @brief Provides control over the logging facilities for @product. - */ - -/** \ingroup RTI_CDS_Logger - * - * @brief The singleton type used to configure @product verbosity - * - * For configuring other aspects such as output file, print format or - * RTI Connext specific logging, use rti::config::Logger. - */ -class Logger -{ -public: - - typedef rti::config::Verbosity Verbosity; - typedef rti::config::LogCategory LogCategory; - typedef rti::config::PrintFormat PrintFormat; - - static Logger& instance() - { - static Logger singleton; - return singleton; - } - - /** - * @brief Sets the verbosity for the log messages generated at the - * @product level. - * - * @param verbosity - * @rs_st_in The verbosity of the service logs - */ - void service_verbosity(rti::config::Verbosity verbosity) - { - NDDS_Config_Logger_set_verbosity_by_service( - NDDS_Config_Logger_get_instance(), - NDDS_CONFIG_LOG_SERVICE_CLOUD_DISCOVERY, - static_cast(verbosity.underlying())); - } - - /** - * @brief Getter for the same attribute - * - * @see service_verbosity(rti::config::Verbosity) - */ - rti::config::Verbosity service_verbosity() - { - RTILogBitmap instrumentation_mask = - NDDS_Config_Logger_get_verbosity_by_service( - NDDS_Config_Logger_get_instance(), - NDDS_CONFIG_LOG_SERVICE_CLOUD_DISCOVERY); - - return static_cast(instrumentation_mask); - } - - /** - * @brief Logs a message with EXCEPTION level - * - * The generated log will be part of logging stream of the running service - * if the service verbosity contains EXCEPTION messages. The result log - * message may include additional information according to the - * Connext logging configuration, such as Advlog Context, thread ID, - * line number, etc. Additionally, the result log message will contain a - * newline character at the end, so the format does not need to contain it. - * - * @param [in] msg Message to be logged - */ - void error(const std::string& msg) - { - this->error(msg.c_str()); - } - - /** - * @brief Overload of error(const std::string& msg) - */ - void error(const char *msg) - { - this->message(rti::config::LogLevel::EXCEPTION, msg); - } - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * WARNING. - * - * @param [in] msg Message to be logged - * - * @see rti::cds::Logger::error - * - */ - void warn(const std::string& msg) - { - this->warn(msg.c_str()); - } - - /** - * @brief Overload of warn(const std::string& msg) - */ - void warn(const char *msg) - { - this->message(rti::config::LogLevel::WARNING, msg); - } - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_LOCAL. - * - * @param [in] msg Message to be logged - * - * @see rti::cds::Logger::error - * - */ - void local(const std::string& msg) - { - this->local(msg.c_str()); - } - - /** - * @brief Overload of local(const std::string& msg) - */ - void local(const char *msg) - { - this->message(rti::config::LogLevel::STATUS_LOCAL, msg); - } - - /** - * @brief Logs a message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_REMOTE. - * - * @param [in] msg Message to be logged - * - * @see rti::cds::Logger::error - * - */ - void remote(const std::string& msg) - { - this->remote(msg.c_str()); - } - - /** - * @brief Overload of remote(const std::string& msg) - */ - void remote(const char *msg) - { - this->message(rti::config::LogLevel::STATUS_REMOTE, msg); - } - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_DEBUG. - * - * @param [in] msg Message to be logged - * - * @see rti::cds::Logger::error - * - */ - void debug(const std::string& msg) - { - this->debug(msg.c_str()); - } - - /** - * @brief Overload of debug(const std::string& msg) - */ - void debug(const char *msg) - { - this->message(rti::config::LogLevel::STATUS_ALL, msg); - } - - virtual ~Logger() - { - } - -private: - - void message(const rti::config::LogLevel& level, const char* msg) - { - RTI_CDS_Logger_log( - static_cast(level.underlying()), - "%s", - msg); - } - - Logger() - { - } - - // Disable copy - Logger(const Logger&); - Logger& operator=(const Logger&); -}; - -}} - -#endif // RTI_CDS_LOGGER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/cds/PropertySet.hpp b/qt6-after/qt6-migrated-legatus/include/rti/cds/PropertySet.hpp deleted file mode 100644 index 3839c8a56..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/cds/PropertySet.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef RTI_CDS_PROPERTYSET_HPP -#define RTI_CDS_PROPERTYSET_HPP - -#include - -namespace rti { namespace recording { - -typedef rti::routing::PropertySet PropertySet; - -}} - -#endif /* RTI_CDS_PROPERTYSET_HPP */ - - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/cds/Service.hpp b/qt6-after/qt6-migrated-legatus/include/rti/cds/Service.hpp deleted file mode 100644 index 1f28adcc3..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/cds/Service.hpp +++ /dev/null @@ -1,200 +0,0 @@ -/** - * (c) Copyright, Real-Time Innovations, 2020. All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_CDS_CLOUD_DISCOVERY_SERVICE_HPP_ -#define RTI_CDS_CLOUD_DISCOVERY_SERVICE_HPP_ - -#include -#include - -#include -#include -#include - -#include "routingservice/routingservice_service.h" -#include "clouddiscoveryservice/clouddiscoveryservice_log.h" - -namespace rti { namespace cds { - -/*e \defgroup RTI_CDS_ServiceLibModule Library API - * - * @brief @product can be deployed as a native library linked into your - * application in select architectures. - * - * This API allows you to create, configure and start @product instances from - * your application. - * - * The following code shows the typical use of the API: - * - * \code - * - * int main () - * { - * rti::cds::Service service( - * rti::cds::ServiceProperty() - * .cfg_file("MyCloudDiscoveryService.xml") - * .service_name("MyCloudDiscoveryService")); - * ... - * - * service.start(); - * - * while (keep_running) { - * sleep(); - * ... - * } - * - * return 0; - * } - * - * \endcode - * - * Instead of a file, you can use XML strings to configure @product. - * See ServiceProperty for more information. - *

- * To build your application you need to link with the @product native library - * in <@ndds home>/bin/<architecture>/ . - * - * An example is provided at https://github.com/rticommunity/rticonnextdds-examples/tree/master/examples/cloud_discovery_service/library_api. - * - * ### Development Requirements - * - * | | Linux Systems | Windows Systems | - * | ----------------------------: | :----------------------------: | :---------------------------: | - * | Link Libraries (Compile Time) | librticlouddiscoveryservice.so | rticlouddiscoveryservice.dll | - * | Shared Libraries (Run Time) | librtiroutingservice.so | rtiroutingservice.dll | - * | ^ | librtidlc.so | rtidlc.dll | - * | ^ | librticonnextmsgc.so | rticonnextmsgc.dll | - * | ^ | libnddsmetp.so | nddsmetp.dll | - * | ^ | librtiapputilsc.so | rtiapputilsc.dll | - * | ^ | librtixml2.so | rtixml2.dll | - * | ^ | libnddscpp2.so | nddscpp2.dll | - * | ^ | libnddsc.so | nddsc.dll | - * | ^ | libnddscore.so | nddscore.dll | - * | Static Libraries | librticlouddiscoveryservicez.a | rticlouddiscoveryservicez.lib | - * | ^ | librtiroutingservicez.a | rtiroutingservicez.lib | - * | ^ | librtidlcz.a | rtidlcz.lib | - * | ^ | librticonnextmsgcz.a | rticonnextmsgcz.lib | - * | ^ | libnddsmetpz.a | nddsmetpz.lib | - * | ^ | librtiapputilscz.a | rtiapputilscz.lib | - * | ^ | librtixml2z.a | rtixml2z.lib | - * | ^ | libnddscpp2z.a | nddscpp2z.lib | - * | ^ | libnddscz.a | nddscz.lib | - * | ^ | libnddscorez.a | nddscorez.lib | - * | Headers | rti/cds/CloudDiscoveryService.hpp | | - * - * NOTE: If you are using debug libraries, remember to add the 'd' suffix - * to the library name. For shared libraries on macOS systems, the library name - * is the same as that for Linux except the extension is '.dylib' instead of '.so'. - */ - -/** \ingroup RTI_CDS_ServiceLibModule - * - * @brief The @product. - * - */ -class Service : public dds::core::Reference { -public: - typedef dds::core::Reference Base; - OMG_DDS_REF_TYPE_NOTYPENAME( - Service, - dds::core::Reference, - CloudDiscoveryServiceImpl); - - /** - * @brief Creates a @product instance - * - * @param property - * @rs_st_in The property to configure @product instance. - * - */ - explicit Service(const ServiceProperty& property) - : Base(new CloudDiscoveryServiceImpl(property)) - { - this->delegate()->remember_reference(this->delegate()); - } - - Service(const RTI_CDS_Property& property) - : Base(new CloudDiscoveryServiceImpl(property)) - { - this->delegate()->remember_reference(this->delegate()); - } - - explicit Service(Base::DELEGATE_REF_T reference) : Base(reference) - { - if (this->delegate()) { - this->delegate()->remember_reference(this->delegate()); - } - } - - /** - * @brief Starts @product. - * - * This is a non-blocking operation. @product will create its own set of - * threads to perform its tasks. - */ - void start() - { - this->delegate()->start(); - } - - /** - * @brief Stops @product. - * - * This operation will block until the instance is fully stopped. - */ - void stop() - { - this->delegate()->stop(); - } - - /** - * @brief Returns true if the @product is started. - * - * This operation is useful to inspect if the @product instance is up and running. - */ - bool is_started() - { - return this->delegate()->is_started(); - } - - /** - * @brief Sets the dds.sec.crypto.rtps_psk_secret_passphrase property - * for the @product instance that is started. - * - * This operation performs an update; if there was no value for the - * dds.sec.crypto.rtps_psk_secret_passphrase property in the XML - * configuration when @product was started, the operation would fail. - * - * @param rtps_psk_secret_passphrase - * The new value for the dds.sec.crypto.rtps_psk_secret_passphrase property - */ - bool update_rtps_psk_secret_passphrase( - const std::string rtps_psk_secret_passphrase) - { - return this->delegate()->update_rtps_psk_secret_passphrase( - rtps_psk_secret_passphrase); - } - - /** - * @deprecated Calling this function at the end of the application is no - * longer necessary. It will be removed in future versions. - */ - static void finalize_globals() - { - rti::cds::Logger::instance().warn( - "Calling 'rti::cds::Service::finalize_globals()' is no " - "longer necessary and the function will be removed in future " - "versions"); - } - -}; - -} } - -#endif // RTI_CDS_CLOUD_DISCOVERY_SERVICE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/cds/ServiceProperty.hpp b/qt6-after/qt6-migrated-legatus/include/rti/cds/ServiceProperty.hpp deleted file mode 100644 index fefdeca66..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/cds/ServiceProperty.hpp +++ /dev/null @@ -1,678 +0,0 @@ -/** - * (c) Copyright, Real-Time Innovations, 2020. All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_CDS_CLOUD_DISCOVERY_SERVICE_PROPERTY_HPP_ -#define RTI_CDS_CLOUD_DISCOVERY_SERVICE_PROPERTY_HPP_ - -/** - * IMPORTANT: macros.hpp must be the first RTI header included in every header - * file so that symbols are exported correctly on Windows - */ -#include -#include - -#include "clouddiscoveryservice/clouddiscoveryservice_infrastructure.h" -#include "clouddiscoveryservice/clouddiscoveryservice_service.h" - -namespace rti { namespace cds { - -/** \ingroup RTI_CDS_ServiceLibModule - * - * @brief Specifies the list of domain IDs to allow or deny. Overrides XML - * configuration if specified. - */ -class DomainListProperty { -public: - DomainListProperty() : allow_domain_ids_(""), deny_domain_ids_("") - { - } - - DomainListProperty(std::string allow_domain_ids, std::string deny_domain_ids) - { - allow_domain_ids_ = allow_domain_ids; - deny_domain_ids_ = deny_domain_ids; - } - - /** - * @brief The list of domain IDs where @product processes the incoming - * participant announcements. - * - * @default Empty string. Use value from XML configuration. - */ - void allow_domain_ids(std::string allow_domain_ids) - { - allow_domain_ids_ = allow_domain_ids; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string& allow_domain_ids() - { - return allow_domain_ids_; - } - - /** - * @brief The list of domain IDs to deny or ignore. Overrides - * \ref allow_domain_ids. - * - * @default Empty string. Use value from XML configuration. - */ - void deny_domain_ids(std::string deny_domain_ids) - { - deny_domain_ids_ = deny_domain_ids; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string& deny_domain_ids() - { - return deny_domain_ids_; - } - -private: - std::string allow_domain_ids_; - std::string deny_domain_ids_; -}; - -/** \ingroup RTI_CDS_ServiceLibModule - * - * @brief Specifies the alias name of the transport to be used by @product for - * sending or receiving announcements. It also indicates the port where incoming - * participant announcements are received. Overrides XML configuration if specified. - * - * Refer to \ref_url_cloud_discovery_service_users_manual_available_transports to - * check the list of aliases for the preconfigured transports. - */ -class TransportUnicastProperty { -public: - TransportUnicastProperty(std::string alias, int receive_port) - { - alias_ = alias; - receive_port_ = receive_port; - } - - /** - * @brief Transport alias name - */ - void alias(std::string alias) - { - alias_ = alias; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string& alias() - { - return alias_; - } - - /** - * @brief Receive port - */ - void receive_port(int receive_port) - { - receive_port_ = receive_port; - } - - /** - * @brief Getter (see setter with the same name) - */ - int receive_port() - { - return receive_port_; - } - -private: - std::string alias_; - int receive_port_; -}; - -class PropertyAdapter { -public: - typedef RTI_CDS_Property native_type; - - static void initialize(native_type& native_value) - { - static const native_type DEFAULT - = RTI_CDS_Property_INITIALIZER; - native_value = DEFAULT; - // Replicating the defaults from the C Library API as specified in service.ifc - native_value.service_verbosity = RTI_LOG_BIT_EXCEPTION; - native_value.dds_verbosity = RTI_LOG_BIT_EXCEPTION; - } - - static void finalize(native_type& native_value) - { - if (native_value.cfg_strings != NULL) { - RTIOsapiHeap_freeArray(native_value.cfg_strings); - native_value.cfg_strings = NULL; - } - - RTI_CDS_Property_finalize(&native_value); - } - - static void copy(native_type& destination, const native_type& source) - { - if (RTI_CDS_Property_copy(&destination, &source) == NULL) { - throw dds::core::Error("Native RTI_CDS_Property_copy"); - } - } - - static bool equals(const native_type& first, const native_type& second) - { - RTIOsapiUtility_unusedParameter(first); - RTIOsapiUtility_unusedParameter(second); - - throw dds::core::UnsupportedError("Unsupported operation: equals"); - } - - static void add_transports_from_native( - std::vector& transport_selection, - const struct RTI_CDS_TransportSelectionProperty *transport_selection_native) - { - for (int i = 0; i < transport_selection_native->count; i++) { - transport_selection.push_back(TransportUnicastProperty( - transport_selection_native->transports[i].alias, - transport_selection_native->transports[i].receive_port)); - } - } - - static void add_transports_to_native( - struct RTI_CDS_TransportSelectionProperty *transport_selection_native, - std::vector& transport_selection) - { - transport_selection_native->count = transport_selection.size(); - for (unsigned int i = 0; i < transport_selection.size(); i++) { - RTIOsapiUtility_strcpy( - transport_selection_native->transports[i].alias, - RTI_CDS_TRANSPORT_UNICAST_PROPERTY_ALIAS_LENGTH_MAX, - transport_selection[i].alias().c_str()); - transport_selection_native->transports[i].receive_port - = transport_selection[i].receive_port(); - } - } - - static void add_domain_list_from_native( - DomainListProperty& domain_ids, - const struct RTI_CDS_DomainListProperty *domain_ids_native) - { - domain_ids.allow_domain_ids(domain_ids_native->allow_domain_ids); - domain_ids.deny_domain_ids(domain_ids_native->deny_domain_ids); - } - - static void add_domain_list_to_native( - struct RTI_CDS_DomainListProperty *domain_ids_native, - DomainListProperty& domain_ids) - { - DDS_String_replace( - &domain_ids_native->allow_domain_ids, - domain_ids.allow_domain_ids().c_str()); - DDS_String_replace( - &domain_ids_native->deny_domain_ids, - domain_ids.deny_domain_ids().c_str()); - } - - static void add_properties_from_native( - std::map& properties, - const RTI_RoutingServiceProperties *native_properties) - { - for (int i = 0; i < native_properties->count; i++) { - properties[native_properties->properties[i].name] = - (const char *) native_properties->properties[i].value; - } - } - - static void add_properties_to_native( - RTI_RoutingServiceProperties *native_properties, - const std::map& properties) - { - RTI_RoutingServiceProperties_finalize(native_properties); - if (!RTI_RoutingServiceProperties_initialize(native_properties)) { - throw dds::core::Error("failed to initialize native property"); - } - - std::map::const_iterator it = properties.begin(); - for (; it != properties.end(); ++it) { - if (!RTI_RoutingServiceProperties_add( - native_properties, - it->first.c_str(), - it->second.c_str())) { - throw dds::core::Error("failed to add native property"); - } - } - } -}; - -class ServiceProperty; - -} - -namespace core { - -template<> -struct native_type_traits { - typedef rti::cds::PropertyAdapter adapter_type; - typedef RTI_CDS_Property native_type; -}; - -} - -namespace cds { - -/** \ingroup RTI_CDS_ServiceLibModule - * - * @brief Configuration properties for a @product object. - * - */ -class ServiceProperty : public rti::core::NativeValueType -{ -public: - RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(ServiceProperty) - - typedef rti::core::NativeValueType Base; - - /** - * @brief Creates a property object with default settings. - */ - ServiceProperty(): Base() - { - } - - ServiceProperty(const struct RTI_CDS_Property &native_property) - : Base(native_property) - { - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string cfg_file() const - { - return native().cfg_file == NULL ? "" : native().cfg_file; - } - - /** - * @brief Path to an @product configuration file - * - * @default Empty string. - */ - ServiceProperty& cfg_file(const std::string& filename) - { - DDS_String_replace( - &native().cfg_file, - filename.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::vector& cfg_strings() const - { - return cfg_strings_; - } - - /** - * @brief XML configuration represented as strings - * - * An array of strings that altogether make up an - * XML document to configure @product. This parameter is used - * only if ServiceProperty::cfg_file is empty. - * - * The reason for using an array instead of one single string is to - * get around the limited size of literal strings. - * In general, if you create the XML string dynamically - * the vector needs only one element. - * - * @default Empty. - */ - ServiceProperty& cfg_strings( - const std::vector& the_cfg_strings) - { - cfg_strings_ = the_cfg_strings; - if (cfg_strings_.size() > 0) { - if (!RTIOsapiHeap_reallocateArray( - (char ***) &native().cfg_strings, - cfg_strings_.size(), - char *)) { - throw dds::core::OutOfResourcesError("cfg_strings native array"); - } - - for (uint32_t i = 0; i < cfg_strings_.size(); i++) { - native().cfg_strings[i] = cfg_strings_[i].c_str(); - } - } - native().cfg_strings_count = static_cast(cfg_strings_.size()); - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string service_name() const - { - return native().service_name == NULL ? "" : native().service_name; - } - - /** - * @brief The name of the @product configuration to run. - * - * This is the name used to find the <cloud_discovery_service> - * XML tag in the configuration file; this is the default name that will - * be used to refer to this execution in remote administration and - * monitoring if application_name isn't specified. - * - * @default Empty string. - */ - ServiceProperty& service_name(const std::string& name) - { - DDS_String_replace(&native().service_name, name.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string application_name() const - { - return native().application_name == NULL ? "" : native().application_name; - } - - /** - * @brief Assigns a name to the execution of the RTI Cloud Discovery Service. - * - * Remote commands and status information will refer to the RTI Cloud Discovery - * Service using this name. - * - * \default service_name if this value is not set. - */ - ServiceProperty& application_name(const std::string& name) - { - DDS_String_replace(&native().application_name, name.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enforce_xsd_validation() const - { - return (native().enforce_xsd_validation == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Controls whether the service applies XSD validation to the loaded - * configuration. - * - * @default true - */ - ServiceProperty& enforce_xsd_validation(const bool enforce_xsd_validation) - { - native().enforce_xsd_validation = enforce_xsd_validation; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool skip_default_files() const - { - return (native().skip_default_files == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Set it to true to avoid loading the - * standard files usually loaded by @product. - * - * Only the configuration in ServiceProperty::cfg_file or - * ServiceProperty::cfg_strings will be loaded. - * - * @default false - */ - ServiceProperty& skip_default_files(const bool& skip) - { - native().skip_default_files = skip - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::vector transport_selection() - { - PropertyAdapter::add_transports_from_native( - transport_selection_, - &native().transport_selection); - - return transport_selection_; - } - - /** - * @brief Specifies the transport and receive ports used to receive and - * send discovery traffic. Specifically, a receive resource is uniquely - * specified by a transport class-receive port pair. - * Overrides XML configuration if specified. - * - * @default Unspecified. Use value from XML configuration. - */ - ServiceProperty& transport_selection( - const std::vector& transport_selection) - { - transport_selection_ = transport_selection; - PropertyAdapter::add_transports_to_native( - &native().transport_selection, - transport_selection_); - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - DomainListProperty domain_list() - { - PropertyAdapter::add_domain_list_from_native( - domain_list_, - &native().domain_list); - - return domain_list_; - } - - /** - * @brief Specifies the set of domain IDs the service will accept - * announcements from. - * - * @default Unspecified. Use value from XML configuration. - */ - ServiceProperty& domain_list( - const DomainListProperty& domain_list) - { - domain_list_ = domain_list; - PropertyAdapter::add_domain_list_to_native( - &native().domain_list, - domain_list_); - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enable_administration() const - { - return (native().enable_administration == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Set this to true to enable remote administration - * or false to disable it. - * - * @default false - */ - ServiceProperty& enable_administration(const bool enable) - { - native().enable_administration = enable - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int administration_domain_id() const - { - return native().administration_domain_id; - } - - /** - * @brief If ServiceProperty::enable_administration is true, this is - * the domain ID to use for remote administration. - * - * Takes precedence over the XML configuration. - * If ServiceProperty::enable_administration is false, this value is not - * used even if remote administration is enabled in the XML configuration. - * - * @default 0 - */ - ServiceProperty& administration_domain_id(const int domain_id) - { - native().administration_domain_id = domain_id; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enable_monitoring() const - { - return (native().enable_monitoring == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Set this to true to enable monitoring or false to disable it. - * - * @default false - */ - ServiceProperty& enable_monitoring(const bool enable) - { - native().enable_monitoring = enable - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int monitoring_domain_id() const - { - return native().monitoring_domain_id; - } - - /** - * @brief If ServiceProperty::enable_monitoring is true, this is - * the domain ID to use for publishing monitoring topics. - * - * Takes precedence over the XML configuration. - * If ServiceProperty::enable_monitoring is false, this value is not - * used even if monitoring is enabled in the XML configuration. - * - * @default 0 - */ - ServiceProperty& monitoring_domain_id(const int domain_id) - { - native().monitoring_domain_id = domain_id; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string license_file_name() const - { - return native().license_file_name == NULL - ? "" - : native().license_file_name; - } - - /** - * @brief Path to an @product license file. - * - * If not empty, this file is checked for a valid license; otherwise, - * default location will be used. This parameter is only used if your - * installation requires a license file. - * - * @default empty string. - */ - ServiceProperty& license_file_name(const std::string& file_name) - { - DDS_String_replace( - &native().license_file_name, - file_name.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::map user_environment() const - { - std::map properties; - - PropertyAdapter::add_properties_from_native( - properties, - &native().user_environment); - - return properties; - } - - /** - * @brief Dictionary of user variables. - * - * The dictionary provides a parallel way to expand XML configuration - * variables in the form $(my_var), when they are not defined in the - * environment. - * - * @default empty - */ - ServiceProperty& user_environment( - const std::map& user_environment) - { - PropertyAdapter::add_properties_to_native( - &native().user_environment, - user_environment); - - return *this; - } - -private: - std::vector cfg_strings_; - std::vector transport_selection_; - DomainListProperty domain_list_; - -}; - -}} - -#endif // RTI_CDS_CLOUD_DISCOVERY_SERVICE_PROPERTY_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/cds/detail/CloudDiscoveryServiceImpl.hpp b/qt6-after/qt6-migrated-legatus/include/rti/cds/detail/CloudDiscoveryServiceImpl.hpp deleted file mode 100644 index 3cf77f49b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/cds/detail/CloudDiscoveryServiceImpl.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/** - * (c) Copyright, Real-Time Innovations, 2020. All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_CDS_CLOUD_DISCOVERY_SERVICE_IMPL_HPP_ -#define RTI_CDS_CLOUD_DISCOVERY_SERVICE_IMPL_HPP_ - -#include -#include -#include -#include "clouddiscoveryservice/clouddiscoveryservice_service.h" - -#include - -namespace rti { namespace cds { - -class CloudDiscoveryServiceImpl - : public rti::core::detail::RetainableType -{ -public: - explicit CloudDiscoveryServiceImpl(const ServiceProperty& property) - { - native_ = RTI_CDS_Service_new(&property.native()); - rti::core::check_create_entity(native_, "CloudDiscoveryService"); - } - - CloudDiscoveryServiceImpl(const RTI_CDS_Property& property) : native_(NULL) - { - native_ = RTI_CDS_Service_new(&property); - rti::core::check_create_entity(native_, "CloudDiscoveryService"); - } - - CloudDiscoveryServiceImpl(RTI_CDS_Service *native) : native_(native) - { - rti::core::check_create_entity(native_, "CloudDiscoveryService"); - } - - ~CloudDiscoveryServiceImpl() - { - RTI_CDS_Service_delete(native_); - } - - void start() - { - if (!RTI_CDS_Service_start(native_)) { - throw dds::core::Error("Error starting CloudDiscoveryService"); - } - } - - void stop() - { - if (!RTI_CDS_Service_stop(native_)) { - throw dds::core::Error("Error stopping CloudDiscoveryService"); - } - } - - bool is_started() - { - return RTI_CDS_Service_is_started(native_); - } - - bool update_rtps_psk_secret_passphrase( - const std::string rtps_psk_secret_passphrase) - { - return RTI_CDS_Service_update_rtps_psk_secret_passphrase( - native_, - rtps_psk_secret_passphrase.c_str()); - } - - RTI_CDS_Service* native() const - { - return native_; - } - -private: - RTI_CDS_Service *native_; -}; - -}} - -#endif // RTI_CDS_CLOUD_DISCOVERY_SERVICE_IMPL_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/AggregationBuilders.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/AggregationBuilders.hpp deleted file mode 100644 index 132fcdbcd..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/AggregationBuilders.hpp +++ /dev/null @@ -1,558 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_AGGREGATIONBUILDERS_HPP_ -#define RTI_DDS_FLAT_AGGREGATIONBUILDERS_HPP_ - -#include "rti/flat/BuilderHelper.hpp" -#include "rti/flat/Builder.hpp" -#include "xcdr/xcdr_interpreter.h" - -namespace rti { namespace flat { - -/* - * Parameters describing a member to be added or built. - * - * The information encoded by this structure is used to set the appropriate - * bits in the header that precedes each member of a mutable type. - */ -struct MemberParams { - /* - * Indicates whether the member is part of the key. - */ - bool key; - /* - * Indicates whether the member is the discriminator of a union. - */ - bool discriminator; - /* - * Indicates whether the member has been marked as "must understand". - */ - bool must_understand; - - MemberParams() : key(false), discriminator(false), must_understand(false) - { } - - /* - * Check whether the current XCDR2 compliance mask allows the - * specified features. - * - * This function will cache the value of the compliance mask to avoid - * repeated nested function calls at runtime. - * - * @param check_mask The feature bits to check in the compliance mask. - * @param reload_mask If true, force reloading of the compliance mask - * from the global configuration. - * @return true if all the bits in check_mask are set in the compliance - * mask. - */ - static bool xcdr2_compliant( - const RTIXCdrXTypesComplianceMask check_mask, - const bool reload_mask) - { - static bool g_compliance_mask_set = false; - static RTIXCdrXTypesComplianceMask g_compliance_mask = 0; - - // Initialize the compliance mask on first use - // There could be a data race here but the worst that can happen is - // that the compliance mask is read more than once. - // The goal is to avoid nested function calls on each and every call. - if (reload_mask || !g_compliance_mask_set) { - g_compliance_mask = - RTIXCdrInterpreter_getGlobalXtypeComplianceMask(); - g_compliance_mask_set = true; - } - - return (g_compliance_mask & check_mask); - } - - /* - * Check if the must_understand bit should be set in the header for this - * member. - * - * The bit will always be set if the must_understand attribute is true. - * Additionally, if the current XCDR2 compliance mask allows it, the bit - * will also be set for key members and discriminators. - * - * @return true if the must_understand bit should be set. - */ - bool has_must_understand_bit() const - { - return must_understand - || (xcdr2_compliant( - RTI_XCDR_XTYPES_MUST_UNDERSTAND_IN_KEY_AND_DISCRIMINATOR_BIT, - false) - && (key || discriminator)); - } -}; - -/* - * Provides the common functionality for builders of aggregated types - * - * Extends and specializes AbstractBuilder to add or override the functionality - * required to build an aggregated type: - * - * - Add or build members, prepending the member header - * - Add dheader at the beginning - * - Add parameter-list-end header at the end - */ -/** - * @ingroup RTIFlatBuildersModule - * @brief Base class of struct and union builders. - * - * This class contains implementation details and doesn't add any public function - * to AbstractBuilder. See MyFlatMutableBuilder for a concrete example of a - * struct builder. - */ -class AggregationBuilder : public AbstractBuilder { -protected: - AggregationBuilder() : - dheader_position_(NULL), - emheader_position_(NULL) - { - } - - // Create a new top-level builder - AggregationBuilder( - unsigned char *initial_buffer, - offset_t size, - bool initialize_members) : - AbstractBuilder(initial_buffer, size, initialize_members), - dheader_position_(NULL), - emheader_position_(NULL) - { - dheader_position_ = stream().serialize_dheader(); - if (dheader_position_ == NULL) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(invalidate()); - } - } - -public: - // For internal use and testing - // - // Modifies the encapsulation set in the constructor with a custom value. - // This function can only be called after the construction of a non-nested - // Builder, before any member is built or added. - // - void set_encapsulation_impl(RTIXCdrEncapsulationId encapsulation_id) - { - // Only a top-level Builder can change the encapsulation - RTI_FLAT_CHECK_PRECONDITION(!is_nested(), return); - - char *current_position = (char *) owned_stream_.current_position(); - // This operation is only valid right after construction, when no - // member has been added yet - RTI_FLAT_CHECK_PRECONDITION( - current_position == dheader_position_ + RTI_XCDR_DHEADER_SIZE, - return); - - owned_stream_.skip_back( - RTI_XCDR_DHEADER_SIZE + RTI_XCDR_ENCAPSULATION_HEADER_SIZE); - - if (!RTIXCdrFlatSample_initializeEncapsulationAndStream( - (char *) owned_stream_.buffer(), - &owned_stream_.c_stream(), - encapsulation_id, - owned_stream_.total_size())) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return); - } - - stream().serialize_dheader(); - } - -protected: - -#if defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) - AggregationBuilder(AggregationBuilder&& other) = default; - - AggregationBuilder& operator=(AggregationBuilder&& other) - { - if (this == &other) { - return *this; - } - - finish_untyped_impl(); - - AbstractBuilder::operator=(static_cast(other)); - - dheader_position_ = other.dheader_position_; - emheader_position_ = other.emheader_position_; - - return *this; - } -#else -public: - // Enable the safe-move-constructor idiom without C++11 move constructors - struct UntypedAggregationBuilderMoveProxy : AbstractBuilderMoveProxy { - char * dheader_position_; - char * emheader_position_; - }; - - operator UntypedAggregationBuilderMoveProxy () throw() // move-constructor idiom - { - UntypedAggregationBuilderMoveProxy other; - move_to(other); - return other; - } - -protected: - void move_from(UntypedAggregationBuilderMoveProxy& other) - { - AbstractBuilder::move_from(other); - dheader_position_ = other.dheader_position_; - emheader_position_ = other.emheader_position_; - } - - void move_to(UntypedAggregationBuilderMoveProxy& other) - { - AbstractBuilder::move_to(other); - other.dheader_position_ = dheader_position_; - other.emheader_position_ = emheader_position_; - } -#endif - -protected: - virtual ~AggregationBuilder() - { - // AggregationBuilder::finish_untyped_impl() is specialized - // with respect to AbstractBuilder::finish_untyped_impl() - finish_untyped_impl(); - } - - template - bool add_primitive_member( - member_id_t id, - T value, - const MemberParams& params) - { - RTI_FLAT_BUILDER_CHECK_VALID(return false); - - rti::xcdr::Stream::Memento stream_memento(stream()); - - if (!begin_emheader(id, detail::primitive_lc_code::value, params)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return false); - } - // no need to call finish_emheader() - - if (!stream().serialize_no_align(value)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return false); - } - - stream_memento.discard(); // success: do not restore the current position - return true; - } - - template - bool add_primitive_member(member_id_t id, T value) - { - static const MemberParams default_params; - return add_primitive_member(id, value, default_params); - } - - template - OffsetType add_member(member_id_t id, const MemberParams& params) - { - RTI_FLAT_BUILDER_CHECK_VALID(return OffsetType()); - - // save state in case of error - rti::xcdr::Stream::Memento stream_memento(stream()); - return add_member(id, stream_memento, params); - } - - template - OffsetType add_member(member_id_t id) - { - RTI_FLAT_BUILDER_CHECK_VALID(return OffsetType()); - - // save state in case of error - rti::xcdr::Stream::Memento stream_memento(stream()); - static const MemberParams default_params; - return add_member(id, stream_memento, default_params); - } - - template - OffsetType add_member( - member_id_t id, - rti::xcdr::Stream::Memento& stream_memento) - { - static const MemberParams default_params; - return add_member(id, stream_memento, default_params); - } - - template - OffsetType add_member( - member_id_t id, - rti::xcdr::Stream::Memento& stream_memento, - const MemberParams& params) - { - // fixed-size non-primitive members may have a dheader or not; when they - // do the LC code is 5, otherwise it is 4. - if (!begin_emheader( - id, - detail::is_fixed_type_w_dheader::value() ? 5 - : 4, - params)) { - return OffsetType(); - } - - OffsetType result = AbstractBuilder::add_element(); - finish_emheader(); - - stream_memento.discard(); // success - do not restore the previous state - return result; - } - - template - NestedBuilder build_member(member_id_t id, const MemberParams& params) - { - RTI_FLAT_BUILDER_CHECK_VALID(return NestedBuilder()); - - // save state in case of error - rti::xcdr::Stream::Memento stream_memento(stream()); - return build_member(id, stream_memento, params); - } - - template - NestedBuilder build_member(member_id_t id) - { - static const MemberParams default_params; - return build_member(id, default_params); - } - - template - NestedBuilder build_member( - member_id_t id, - rti::xcdr::Stream::Memento& stream_memento) - { - static const MemberParams default_params; - return build_member(id, stream_memento, default_params); - } - - template - NestedBuilder build_member( - member_id_t id, - rti::xcdr::Stream::Memento& stream_memento, - const MemberParams& params) - { - if (!begin_emheader( - id, - static_cast( - detail::lc_code::value()), - params)) { - return NestedBuilder(); - } - - return AbstractBuilder::build_element_no_align( - stream_memento); - } - - unsigned char* finish_sample_impl() - { - RTI_FLAT_BUILDER_CHECK_VALID(return NULL); - RTI_FLAT_BUILDER_CHECK_NOT_BOUND(return NULL); - RTI_FLAT_BUILDER_CHECK_CAN_FINISH_SAMPLE(return NULL); - - if (!stream().finish_dheader(dheader_position_)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return NULL); - } - - unsigned char *return_sample = stream().buffer(); - invalidate(); - - return return_sample; - } - - // Same as finish_impl() but it doesn't throw exceptions or return an Offset - void finish_untyped_impl() - { - if (is_valid() && is_nested()) { - stream().finish_dheader(dheader_position_); - AbstractBuilder::finish_untyped_impl(); - } - } - - template - OffsetType finish_impl() - { - RTI_FLAT_BUILDER_CHECK_VALID(return OffsetType()); - RTI_FLAT_BUILDER_CHECK_CAN_FINISH(return OffsetType()); - - stream().finish_dheader(dheader_position_); - return AbstractBuilder::finish_impl(); - } - -public: - // For internal use; need to use rti::flat::discard_sample(writer, builder) - unsigned char * discard_sample_impl() - { - RTI_FLAT_BUILDER_CHECK_VALID(return NULL); - RTI_FLAT_BUILDER_CHECK_NOT_BOUND(return NULL); - RTI_FLAT_BUILDER_CHECK_CAN_FINISH_SAMPLE(return NULL); - - unsigned char *buffer = this->buffer(); - invalidate(); - return buffer; - } - -private: - void finish_member() // override noexcept - { - if (!is_valid()) { - return; - } - - finish_emheader(); - AbstractBuilder::finish_member(); - } - -private: - bool begin_emheader( - member_id_t id, - RTIXCdrUnsignedLong lc, - const MemberParams& params) - { - RTI_FLAT_BUILDER_CHECK_NOT_BOUND(return false); - - if (!stream().serialize_emheader( - emheader_position_, - id, - lc, - params.has_must_understand_bit())) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return false); - } - - return true; - } - - void finish_emheader() // noexcept - { - if (emheader_position_ != NULL) { - stream().finish_emheader(emheader_position_); - emheader_position_ = NULL; - } - } - -protected: - // Create a nested builder - AggregationBuilder(nested_tag_t, AbstractBuilder& parent, unsigned int alignment) - : AbstractBuilder(nested_tag_t(), parent, alignment), - dheader_position_(NULL), - emheader_position_(NULL) - { - dheader_position_ = stream().serialize_dheader(); - if (dheader_position_ == NULL) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(invalidate()); - } - } - -private: - char * dheader_position_; - char * emheader_position_; -}; - -// Specializes an AggregationBuilder to enforce that only one member can -// be set at a time -/** - * @ingroup RTIFlatBuildersModule - * @brief Base class of builders for user-defined mutable unions. - * - * Union builders can only add or build a single member. - * - * This class contains implementation details and doesn't add any public function - * to AbstractBuilder. - */ -template -class UnionBuilder : public AggregationBuilder { -protected: - UnionBuilder() - { - } - - // Create a new top-level builder - UnionBuilder( - unsigned char *initial_buffer, - offset_t size, - bool initialize_members) : - AggregationBuilder(initial_buffer, size, initialize_members) - { - } - - template - bool add_primitive_member(member_id_t id, Discriminator disc, T value) - { - RTI_FLAT_BUILDER_CHECK_VALID(return false); - - // Always start at the beginning and override any member or discriminator - // that may have been set - move_to_discriminator(); - rti::xcdr::Stream::Memento stream_memento(stream()); - - if (!add_discriminator(disc)) { - return false; - } - - if (!AggregationBuilder::add_primitive_member(id, value)) { - return false; - } - - stream_memento.discard(); // success: do not restore the current position - return true; - } - - template - OffsetType add_member(member_id_t id, Discriminator disc) - { - RTI_FLAT_BUILDER_CHECK_VALID(return OffsetType()); - - move_to_discriminator(); - rti::xcdr::Stream::Memento stream_memento(stream()); - if (!add_discriminator(disc)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return OffsetType()); - } - - return AggregationBuilder::add_member(id, stream_memento); - } - - template - NestedBuilder build_member(member_id_t id, Discriminator disc) - { - RTI_FLAT_BUILDER_CHECK_VALID(return NestedBuilder()); - - move_to_discriminator(); - rti::xcdr::Stream::Memento stream_memento(stream()); - add_discriminator(disc); - - return AggregationBuilder::build_member(id, stream_memento); - } - - // Create a nested builder - UnionBuilder(nested_tag_t, AbstractBuilder& parent, unsigned int alignment) - : AggregationBuilder(nested_tag_t(), parent, alignment) - { - } - -private: - void move_to_discriminator() - { - stream().current_position(begin_position() + RTI_XCDR_DHEADER_SIZE); - } - - bool add_discriminator(Discriminator disc) - { - MemberParams params; - params.discriminator = true; - return AggregationBuilder::add_primitive_member(0, disc, params); - } -}; - - -} } - -#endif // RTI_DDS_FLAT_AGGREGATIONBUILDERS_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/Builder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/Builder.hpp deleted file mode 100644 index e04453f27..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/Builder.hpp +++ /dev/null @@ -1,1007 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_BUILDER_HPP_ -#define RTI_DDS_FLAT_BUILDER_HPP_ - -#include "xcdr/xcdr_stream.h" -#include "xcdr/xcdr_stream_impl.h" -#include "xcdr/xcdr_interpreter.h" -#include "xcdr/xcdr_interpreter.h" - -#include "rti/xcdr/Stream.hpp" -#include "rti/flat/ExceptionHelper.hpp" -#include "rti/flat/SequenceOffsets.hpp" - -/** - * @defgroup RTIFlatBuildersModule FlatData Builders - * @ingroup RTIFlatDataModule - * @brief A Builder allows creating and initializing variable-size data - * - * Builders allow creating variable-size \ref RTIFlatSampleModule "FlatData samples", - * as described in \ref PublishingFlatData. - * - * There are the following Builder types: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
CategoryBuilder type
User types For example:
    - *
  • MyFlatMutableBuilder, a mutable struct
  • - *
  • MyFlatUnionBuilder, a union
  • - *
  • Final structs are fixed-size and do not have a Builder (see for - * example MyFlatMutableBuilder::add_my_final()). - *
Arrays
    - *
  • rti::flat::MutableArrayBuilder
  • - *
  • Arrays of final elements are fixed-size and do not have a Builder - * (see for example MyFlatMutableBuilder::add_my_final_array()).
  • - *
Sequences
    - *
  • rti::flat::MutableSequenceBuilder for sequences of mutable elements
  • - *
  • rti::flat::FinalSequenceBuilder for sequences of final elements
  • - *
  • rti::flat::PrimitiveSequenceBuilder for sequences of primitive elements
  • - *
  • rti::flat::StringBuilder
  • - *
Primitive types
    - *
  • Primitive members are added using one of the member functions of the - * Builder of the type that contains them. See for example - * MyFlatMutableBuilder::add_my_primitive()
  • < - *
- * - * Builder for user types, such as MyFlatMutableBuilder, can behave as - * sample builders, when they build a sample, or member builders - * when they build a member for another Builder (such as the Builder returned - * by MyFlatMutableBuilder::build_my_mutable()). All the other Builder types - * (sequences, arrays) are always member builders (such as the Builder returned - * by MyFlatMutableBuilder::build_my_final_seq()). - * - * Builders are move-only types. They cannot be copied, only moved. When - * you assign a Builder as the return value of a function, this happens - * automatically. - * - * \code - * // the return value of 'build_data' is moved into 'builder' - * MyFlatMutableBuilder builder = rti::flat::build_data(writer); - * \endcode - * - * To explicitly move a Builder variable \if CPP_LANGUAGE_ONLY in - * the Traditional C++ API, call its \p move() member function\else use \p std::move() - * in C++11 platforms or call the \p move() member function in pre-C++11 platforms. - * \endif - * - * @section BuilderErrorManagement Builder Error Management - * \if CPP_LANGUAGE_ONLY - * The Traditional C++ API reports Builder errors by setting a flag - * that can be checked with the member function \ref rti::flat::AbstractBuilder::check_failure() - * "check_failure()". After each Builder operation, \p check_failure() must be - * called to check (and clear) the error flag. - * - * In addition, in case of error, operations that return another Builder, such - * as MyFlatMutableBuilder::build_my_mutable(), return an invalid Builder - * (\ref rti::flat::AbstractBuilder::is_valid() "is_valid()" is \p false). - * Operations that return an - * Offset, such as MyFlatMutableBuilder::add_my_final() return a "null" Offset - * when they fail (see \ref OffsetErrorManagement). - * \endif - * \if CPP2_LANGUAGE_ONLY - * In the Modern C++ API errors are notified with exceptions. Builder operations - * may throw the following exceptions - * - dds::core::PreconditionNotMetError, for any precondition failure. - * - dds::core::OutOfResourcesError, when the Builder's underlying buffer runs - * out of space (this should not happen when the Builder has been created with - * rti::flat::build_data()). - * - * See also \ref OffsetErrorManagement. - * \endif - * - * @see MyFlatMutableBuilder for more information specific to builders for user - * types. - */ - -#ifdef DOXYGEN_DOCUMENTATION_ONLY - -/** - * @ingroup RTIFlatBuildersModule - * @brief Represents the Builder for an arbitrary user-defined mutable type - * - * This example type represents the \ref RTIFlatBuildersModule "Builder" type - * that \nddsgen would generate for \ref MyFlatMutable and allows creating a - * sample or a member of that type. - * - * The most common way to create a Builder is rti::flat::build_data(), which - * obtains a managed sample from a \idref_FooDataWriter as described in - * \ref PublishingFlatData. It is also possible to create a Builder with an - * arbitrary buffer using the constructor that receives the buffer and its size. - * - * When a Builder is created, the type is empty--it doesn't contain any members. - * The Builder provides functions to create each member. There are two kind of - * functions: \p add functions and \p build functions. - * - * Adding fixed-size members - * ------------------------- - * Fixed-size members are "added", and the corresponding function is called - * \p add_. "Add" functions directly place the member in - * the buffer, and return an \ref RTIFlatOffsetsModule "Offset" that allows - * setting its values. - * - * By default, after calling \p add_ the - * member values are uninitialized. This behavior can be changed by creating - * the writer with - * \idref_DataWriterResourceLimitsQosPolicy_initialize_writer_loaned_sample; - * this is however not recommended in general because of the performance impact - * for large types. - * - * \code - * MyFlatMutableBuilder builder = ...; - * MyFinalFooOffset member_offset = builder.add_my_final(); - * member_offset.my_primitive(10); - * // ... add/build more members - * \endcode - * - * - * - * Building variable-size members - * ------------------------------ - * Variable-size members are "built", and the function is called - * \p build_. "Build" functions return another - * \ref RTIFlatBuildersModule "Builder" to build the member. - * - * \code - * MyFlatMutableBuilder builder = ...; - * auto member_builder = builder.build_my_mutable(); - * // ... use member_builder - * member_builder.finish(); - * // ... add/build more members - * \endcode - * - * While a member is being built, the parent Builder is a bound state, - * which prevents any changes to it until the member has been finished by calling - * \p member_builder.finish(). In particular, the member Builder must be finished - * before adding or building any other member, or before finishing \p builder. - * - * Choosing which members are included - * ----------------------------------- - * The \p add/build function for each member can be called one or zero times. - * That is, all members are optional, even those without the \p \@optional IDL - * annotation. However \p \@key member must be added or \idref_FooDataWriter_write - * will fail. - * - * FlatData samples received by \idref_DataReader will not - * contain the members that were not added/built--the corresponding member getters - * return a null Offset. A \idref_DataReader for an equivalent non-FlatData - * (plain) definition of this type will assign default values to any non-optional - * members that were not present in the sample when written. - * - * It is not permitted to add a member more than once, but builders don't enforce - * this. Trying to build/add a member more than once may cause the Builder to - * overflow (see \ref BuilderErrorManagement). If it doesn't, it may be - * possible to write and read the data samples, but the duplicate members will - * be ignored. - * - * @see \ref RTIFlatBuildersModule - */ -class NDDSUSERDllExport MyFlatMutableBuilder : public rti::flat::AggregationBuilder { - public: - /** - * @brief The related offset type - */ - typedef MyFlatMutableOffset Offset; - - /** - * @brief Creates an invalid Builder - * - * @post !is_valid() - * - * @note Top-level builders are created with rti::flat::build_data(), and - * member builders are created with the corresponding \p build_ - * function. - */ - MyFlatMutableBuilder() - { - } - - /** - * @brief Construct a Builder with an arbitrary buffer - * - * @note The recommended way to create a Builder is rti::flat::build_data() - * as described in \ref PublishingFlatData. This constructor provides an - * alternative option to use an arbitrary data buffer. - * - * @param buffer The buffer that will be used to build the data sample - * @param size The size of the buffer - * @param initialize_members Whether fixed-size elements added to this - * Builder will be initialized to their default values or will be left - * uninitialized (more efficient). - * - * If the sample being built overflows the buffer size, the add/build - * operations will fail. See \ref BuilderErrorManagement. - */ - MyFlatMutableBuilder( - unsigned char *buffer, - int32_t size, - bool initialize_members = false) - { - } - - /** - * @brief Finishes building a member - * - * @return The Offset to the member (normally it can be ignored) - * - * @pre \ref rti::flat::AbstractBuilder::is_nested() "is_nested()". That is, - * this object must be a member Builder, not a sample Builder. - */ - Offset finish(); - - /** - * @brief Finishes building a sample - * - * @pre \ref rti::flat::AbstractBuilder::is_nested() "!is_nested()". - * That is, this object must be a sample Builder, not a member Builder. - * @post \ref rti::flat::AbstractBuilder::is_valid "!is_valid()". - * That is, this Builder can no longer be used. - * - * @return The sample, ready to be written. - * - * This function completes and returns the sample built with this Builder. - * - * @see rti::flat::build_data(), the function to create a - * \idref_FooDataWriter-managed sample Builder. - */ - MyFlatMutable * finish_sample(); - - /** - * @brief Adds a primitive member - */ - bool add_my_primitive(int32_t value); - - /** - * @brief Adds a primitive member - */ - bool add_my_optional_primitive(int32_t value); - - /** - * @brief Adds a primitive array member - * - * @return The Offset to the array, which can be used to set its values. - */ - rti::flat::PrimitiveArrayOffset add_my_primitive_array(); - - /** - * @brief Begins building a primitive-sequence member - */ - rti::flat::PrimitiveSequenceBuilder build_my_primitive_seq(); - - /** - * @brief Adds a final complex member - * - * @return The Offset to the member, which can be used to set its values. - */ - MyFlatFinalOffset add_my_final(); - - /** - * @brief Adds an array member of final complex elements - * - * @return The Offset to the array, which can be used to set its values. - */ - rti::flat::FinalAlignedArrayOffset add_my_final_array(); - - /** - * @brief Begins building a sequence member of final complex elements - */ - rti::flat::FinalSequenceBuilder build_my_final_seq(); - - /** - * @brief Begins building a mutable complex member - * - * FlatMutableBar represents another arbitrary mutable FlatData type. - */ - FlatMutableBarBuilder build_my_mutable(); - - /** - * @brief Begins building an array member of mutable complex elements - */ - rti::flat::MutableArrayBuilder build_my_mutable_array(); - - /** - * @brief Begins building a sequence member of mutable complex elements - */ - rti::flat::MutableSequenceBuilder build_my_mutable_seq(); - - /** - * @brief Begins building a string member - */ - rti::flat::StringBuilder build_my_string(); - - /** - * @brief Begins building a sequence member of string elements - */ - rti::flat::MutableSequenceBuilder build_my_string_seq(); -}; - -/** - * @ingroup RTIFlatBuildersModule - * @brief Represents the Builder for an arbitrary user-defined mutable IDL union - * - * This example type represents the \ref RTIFlatBuildersModule "Builder" type - * that \nddsgen would generate for \ref MyFlatUnion and allows creating a - * sample or a member of that type. - * - * Union builders are similar to struct builders (see MyFlatMutableBuilder), - * except that they only allow adding/building one member. - * - * "Add" and "build" functions automatically set the discriminator value that - * in the IDL definition selects that member. If more than one discriminator - * value selects a member, the add/build function allows picking one. - * - */ -class MyFlatUnionBuilder : public rti::flat::UnionBuilder { -public: - /** - * @brief The related offset type - */ - typedef MyFlatUnionOffset Offset; - - - /** - * @brief Creates an invalid Builder - * - * @post !is_valid() - * - * @note Top-level builders are created with rti::flat::build_data(), and - * member builders are created with the corresponding \p build_ - * function. - */ - MyFlatUnionBuilder() - { - } - - /** - * @brief Finishes building a member - * - * @see MyMutableBuilder::finish() - */ - Offset finish(); - - - /** - * @brief Finishes building a sample - * - * @see MyMutableBuilder::finish_sample() - */ - MyFlatUnion * finish_sample(); - - /** - * @brief Adds a primitive member - * - * This function automatically selects the discriminator 0, which corresponds - * to the member 'my_primitive' (see \ref MyFlatUnion) - */ - bool add_my_primitive(int32_t value); - - /** - * @brief Builds a mutable-struct member - * - * @param discriminator Allows selecting one of the possible discriminator - * values for this member: 1 or 2. This argument is optional: if not - * specified it selects the first 'case' label in the IDL definition (1). - * - * @return The Builder to build this member - */ - MyFlatMutableBuilder build_my_mutable(int32_t discriminator = 1); - - /** - * @brief Adds a final-struct member - * - * @return The Offset to the member, which can be used to set its values. - * - * This function automatically selects the discriminator value 3, which - * corresponds to the member 'my_final' (see \ref MyFlatUnion). - */ - MyFlatFinal::Offset add_my_final(); -}; - -#endif - -namespace rti { namespace flat { - -// Support for move constructor and assignment operator in C++98 -// -// All concrete subclasses of AbstractBuilder must use this macro to implement -// move semantics -// -#if defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) -#define RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL(TYPE, BASE, PROXY) -#define RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS(TYPE, BASE) -#define RTI_FLAT_MOVE_BUILDER(BUILDER) BUILDER -#else -#define RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL(TYPE, BASE, PROXY) \ -public: \ - TYPE(PROXY other) throw() \ - { \ - this->move_from(other); \ - } \ - TYPE& operator=(PROXY other) throw() \ - { \ - this->finish_untyped_impl(); \ - this->move_from(other); \ - return *this; \ - } \ - TYPE move() \ - { \ - return TYPE(PROXY(*this)); \ - } \ -private: \ - TYPE(TYPE&); \ - TYPE& operator=(TYPE&); - -// Shortcut for generated IDL types -#define RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS(TYPE, BASE) \ - RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL( \ - TYPE, BASE, UntypedAggregationBuilderMoveProxy) - -#define RTI_FLAT_MOVE_BUILDER(BUILDER) (BUILDER).move() -#endif - -namespace detail { - // Template parameters can be AbstractBuilder or AbstractBuilderMoveProxy - template - void move_abstract_builder(Builder1& to, Builder2& from) - { - if (from.parent_builder_ == NULL) { - to.owned_stream_ = from.owned_stream_; - } - - to.parent_stream_ = from.parent_stream_; - to.parent_builder_ = from.parent_builder_; - to.begin_position_ = from.begin_position_; - to.bind_position_ = from.bind_position_; - to.initialize_on_add_ = from.initialize_on_add_; -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - to.failure_ = from.failure_; -#endif - - from.parent_stream_ = NULL; - from.parent_builder_ = NULL; - from.bind_position_ = NULL; - from.begin_position_ = NULL; - } -} - -/* - * @brief Provides the functionality common to all builders - * - * This class is the base of all builders and provides the following - * functionality: - * - * - Get the buffer and its size - * - Add final elements (base case) - * - Build operations--create nested builders, binding (base case) - * - Finish operation--unbind (base case) - * - Discard operation--throw away a nested Builder and roll back the parent - * - Error management when exceptions are not supported (traditional C++) - * - Move semantics (base case) - */ -/** - * @ingroup RTIFlatBuildersModule - * @brief Base class of all \ref RTIFlatBuildersModule "Builders" - */ -class AbstractBuilder { -protected: - AbstractBuilder() - : parent_stream_(NULL), - parent_builder_(NULL), - begin_position_(NULL), - bind_position_(NULL), - initialize_on_add_(false) -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - , failure_(false) -#endif - { - } - - /*i - * @brief Create a new top-level Builder - */ - AbstractBuilder(unsigned char *buffer, offset_t size, bool initialize_members) - : parent_stream_(NULL), - parent_builder_(NULL), - bind_position_(NULL), - initialize_on_add_(initialize_members) -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - , failure_(false) -#endif - { - // Serializes the encapsulation into the buffer and initializes the - // stream with that buffer and that encapsulation - if (!RTIXCdrFlatSample_initializeEncapsulationAndStream( - (char *) buffer, - &owned_stream_.c_stream(), - RTIXCdrEncapsulationId_getNativePlCdr2(), - size)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return); - } - - begin_position_ = owned_stream_.current_position(); - } - -protected: - template - friend void detail::move_abstract_builder(Builder1& to, Builder2& from); - -#if defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) - AbstractBuilder(AbstractBuilder&& other) - { - detail::move_abstract_builder(*this, other); - } - - AbstractBuilder& operator=(AbstractBuilder&& other) - { - if (this == &other) { - return *this; - } - - finish_untyped_impl(); - - detail::move_abstract_builder(*this, other); - - return *this; - } -#else - // Enables the safe-move-constructor idiom without C++11 move constructors - struct AbstractBuilderMoveProxy { - rti::xcdr::Stream owned_stream_; - rti::xcdr::Stream *parent_stream_; - AbstractBuilder *parent_builder_; - unsigned char *begin_position_; - unsigned char *bind_position_; - bool initialize_on_add_; -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - bool failure_; -#endif - }; - - void move_from(AbstractBuilderMoveProxy& other) - { - detail::move_abstract_builder(*this, other); - } - - void move_to(AbstractBuilderMoveProxy& other) - { - detail::move_abstract_builder(other, *this); - } - - operator AbstractBuilderMoveProxy () throw() // move-constructor idiom - { - AbstractBuilderMoveProxy other; - move_to(other); - return other; - } -private: - AbstractBuilder(AbstractBuilder& other); - AbstractBuilder& operator=(AbstractBuilder& other); -#endif - -protected: - /** - * @brief If this is a member Builder, it calls finish(). - * - * If this Builder is building a member (that is, is_nested() is true), and - * the object goes out of scope before finish() has been called, its - * destructor calls finish(). Note, however, that it won't report any error. - * - * If this Builder is building a sample (!is_nested()), its destructor doesn't - * do anything. - * - */ - virtual ~AbstractBuilder() - { - finish_untyped_impl(); - } - - struct nested_tag_t {}; // disambiguate copy constructor - - /*i - * @brief Creates a nested Builder to build a member or element - * - * @param parent The Builder for the type that contains the member or element - * this Builder builds. - * - * @param alignment Specifies the alignment required by the concrete Builder. - * Namely, aggregation and sequence builders require alignment of 4 for the - * DHeader and the sequence length, respectively. This alignment doesn't - * reflect the alignment requirement of the elements, that's why arrays do - * not require an alignment here. If no alignment is required, this parameter - * must be zero. Concrete classes must provide a default value for alignment, - * that indicates their requirement. This parameter can be overridden by - * build_element_no_align to when we know we don't need to align. - */ - AbstractBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment) - : /* owned_stream_ empty and unused */ - parent_stream_(&parent.stream()), /* work on the parent's stream */ - parent_builder_(&parent), - begin_position_(NULL), - bind_position_(NULL), - initialize_on_add_(parent.initialize_on_add_) -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - , failure_(false) -#endif - { - if (alignment != 0) { - if (!stream().align(alignment)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return); - } - } - begin_position_ = stream().current_position(); - } - - unsigned char * buffer() - { - return stream().buffer(); - } - - unsigned char * begin_position() - { - return begin_position_; - } - - /*i - * @brief Adds a fixed-size member or element - * - * @return The offset to the member or element that was added. This offset - * can be used to initialize it. - */ - template - OffsetType add_element() - { - RTI_FLAT_BUILDER_CHECK_VALID(return OffsetType()); - RTI_FLAT_BUILDER_CHECK_NOT_BOUND(return OffsetType()); - - offset_t member_size = OffsetType::serialized_size(0); - unsigned char *pos = stream().current_position(); - if (detail::is_fixed_type_w_dheader::value()) { - pos = (unsigned char *) stream().serialize_dheader(); - if (pos == NULL) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return OffsetType()); - } - } - if (!stream().skip(member_size)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return OffsetType()); - } - if (detail::is_fixed_type_w_dheader::value()) { - stream().finish_dheader((char *) pos); - } - - if (initialize_on_add_) { - OffsetType offset( - (SampleBase *) stream().buffer(), - detail::ptrdiff(pos, stream().buffer())); - - detail::final_offset_initializer::initialize(offset); - - return offset; - } else { - return OffsetType( - (SampleBase *) stream().buffer(), - detail::ptrdiff(pos, stream().buffer())); - } - } - - /*i - * @brief Creates a nested Builder to build a variable-size member or element - * - * @param stream_memento Subclasses using build_element() to implement - * their own build method are required to provide a stream memento that - * contains the position in the stream before any bytes related to this - * member were added. Any error before the nested Builder is created will - * cause the memento's destructor to roll back the Builder to its state - * before this member was added. If the Builder can be created without errors - * stream_mement.discard() is called, and its position is kept in case - * the nested Builder is discarded (instead of finished), which also rolls - * back the parent Builder to its previous state. - * - * @post This Builder becomes "bound" until the returned Builder is finished. - * While bound, this Builder can't be used to add or build more elements. - * - * @return The Builder that allows building this member or element - */ - template - NestedBuilder build_element(rti::xcdr::Stream::Memento& stream_memento) - { - RTI_FLAT_BUILDER_CHECK_VALID(return NestedBuilder()); - RTI_FLAT_BUILDER_CHECK_NOT_BOUND(return NestedBuilder()); - - NestedBuilder nested_builder(nested_tag_t(), *this); - RTI_FLAT_BUILDER_CHECK_CREATE_BUILDER( - nested_builder, - return NestedBuilder()); - - bind_position_ = stream_memento.discard(); - - // uninit_use_in_call is not possible given how the constructor for - // the NestedBuilder type is generated by rtiddsgen. The warning is - // suppressed for performance reasons. - /* coverity[uninit_use_in_call : FALSE] */ - return RTI_FLAT_MOVE_BUILDER(nested_builder); - } - - template - NestedBuilder build_element_no_align(rti::xcdr::Stream::Memento& stream_memento) - { - RTI_FLAT_BUILDER_CHECK_VALID(return NestedBuilder()); - RTI_FLAT_BUILDER_CHECK_NOT_BOUND(return NestedBuilder()); - - // By passing '0' to the builder constructor we override its default - // argument which indicates its required alignment - NestedBuilder nested_builder(nested_tag_t(), *this, 0); - RTI_FLAT_BUILDER_CHECK_CREATE_BUILDER( - nested_builder, - return NestedBuilder()); - - bind_position_ = stream_memento.discard(); - - // uninit_use_in_call is not possible given how the constructor for - // the NestedBuilder type is generated by rtiddsgen. The warning is - // suppressed for performance reasons. - /* coverity[uninit_use_in_call : FALSE] */ - return RTI_FLAT_MOVE_BUILDER(nested_builder); - } - - /*i - * @brief Returns the currently used number of bytes - * - * The current size is the number of bytes that have been used to create - * this sample by adding or building members. - * - * When current_size() reaches capacity(), the Builder will fail to add - * or build any additional member. - * - * @see capacity(). - */ - unsigned int current_size() - { - return detail::ptrdiff(stream().current_position(), begin_position_); - } - - - friend class AggregationBuilder; // to access finish_member() - - // Finishes this nested builder, updating the parent builder. - // - // This function doesn't throw exceptions and doesn't return a typed Offset - // This function can be used in destructors to "silently" finish the builder - void finish_untyped_impl() - { - if (!is_valid() || !is_nested()) { - return; - } - - parent_builder_->finish_member(); - invalidate(); - } - -protected: - /*i - * @brief Complete the building of a nested member - * - * Concrete Builders must implement a finish() function with the following body: - * - * RTI_FLAT_BUILDER_CHECK_CAN_FINISH(...); - * // optionally, additonal work - * return finish_impl(); - * - * Destructors can directly call finish_untyped_impl(); - * - * When this is a nested Builder, this function indicates that this element - * or member is complete. - * - * This function is automatically called by the Builder destructor. - * - * Concrete builders must override this function to return a typed Offset to - * the element that was built. - * - * @post This Builder is in an empty state and cannot be used further - * - * @return The position in the buffer where this element ended. - */ - template - OffsetType finish_impl() - { - RTI_FLAT_BUILDER_CHECK_VALID(return OffsetType()); - - unsigned char *begin_pos = this->begin_position_; - unsigned char *sample_base = stream().buffer(); - unsigned char *current_pos = stream().current_position(); - finish_untyped_impl(); - - return OffsetType( - reinterpret_cast(sample_base), // start of the top-level sample - detail::ptrdiff(begin_pos, sample_base), // absoute offset to the member - detail::ptrdiff(current_pos, begin_pos)); // size of the member - } - -public: - /** - * @brief Discards a member in process of being built - * - * This function ends the creation of a member, returning the Builder of - * the type that contains the member to its previous state, as if this - * member had never been built. - * - * @pre This object must be a member Builder, not a sample Builder. - * - * This method is useful when during the building of a member an error - * occurs and the application wants to roll back, instead of finishing an - * incomplete member. - */ - void discard() - { - RTI_FLAT_BUILDER_CHECK_VALID(return); - RTI_FLAT_BUILDER_CHECK_CAN_FINISH(return); - - parent_builder_->discard_member(); - invalidate(); - } - - /** - * @brief Returns whether this is a member Builder - * - * A member Builder is a Builder that has been created - * by calling a \p "build_" function on another Builder (for - * example, MyFlatMutableBuilder::build_my_mutable()). - * - * @return True if this is a member Builder, or false if this is a sample - * Builder. - */ - bool is_nested() const - { - return parent_builder_ != NULL; - } - - /** - * @brief Whether this Builder is valid - * - * A Builder is not valid when it is default-constructed, or after any - * of these functions is called: finish(), finish_sample(), discard(). - * - * \if CPP_LANGUAGE_ONLY - * Since the Traditional C++ API doesn't use exceptions, certain function - * failures due to the Builder running out resources are also reported by - * invalidating the Builder. - * \endif - */ - bool is_valid() const - { - return begin_position_ != NULL; - } - - /** - * @brief Returns the total capacity in bytes - * - * The capacity is the total number of bytes this Builder can contain. For - * a sample Builder (that is, one such that is_nested() returns false), - * rti::flat::build_data reserves enough bytes to accommodate any sample of - * a given type. - */ - rti::xcdr::length_t capacity() const - { - return stream().total_size(); - } - -protected: - // Makes this Builder invalid after finish(); discard(); finish_sample(); - // and, when exceptions are not enabled (traditional C++ API), after an - // error during construction - void invalidate() - { - parent_stream_ = NULL; - parent_builder_ = NULL; - bind_position_ = NULL; - begin_position_ = NULL; - } - - // This function is called by a nested Builder when it has finished building - // an element - virtual void finish_member() // noexcept - { - if (!is_valid()) { - return; - } - - bind_position_ = NULL; - } - - void discard_member() - { - RTI_FLAT_BUILDER_CHECK_VALID(return); - - stream().current_position(bind_position_); - bind_position_ = NULL; - } - - rti::xcdr::Stream& stream() - { - if (parent_stream_ != NULL) { - return *parent_stream_; - } else { - return owned_stream_; - } - } - - const rti::xcdr::Stream& stream() const - { - if (parent_stream_ != NULL) { - return *parent_stream_; - } else { - return owned_stream_; - } - } - -private: - rti::xcdr::Stream owned_stream_; - rti::xcdr::Stream *parent_stream_; - AbstractBuilder *parent_builder_; - unsigned char *begin_position_; - unsigned char *bind_position_; - bool initialize_on_add_; - -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS -public: - /** - * @brief Checks if the previous operation failed and resets the failure flag - * - * This function must be called after each Builder operation to check if - * it succeeded. Note that after calling check_failure() the error flag is - * reset, so a subsequent call will always return false. - * - * @return True if there was a failure in the previous operation, false - * if there was no failure since the last call to check_failure. - */ - bool check_failure() - { - bool failure = failure_; - failure_ = false; - return failure; - } -protected: - void set_failure() - { - failure_ = true; - } -private: - bool failure_; -#endif - - -}; - -} } - -#endif // RTI_DDS_FLAT_BUILDER_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/BuilderHelper.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/BuilderHelper.hpp deleted file mode 100644 index 08127c153..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/BuilderHelper.hpp +++ /dev/null @@ -1,220 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_BUILDERHELPER_HPP_ -#define RTI_DDS_FLAT_BUILDERHELPER_HPP_ - -namespace rti { namespace flat { - -template -class PrimitiveSequenceBuilder; - -template -class MutableSequenceBuilder; - -template -class FinalSequenceBuilder; - -template -class MutableArrayBuilder; - -class StringBuilder; - -namespace detail { - -// -// lc_code: -// - -template -struct primitive_lc_code_helper; - -template <> -struct primitive_lc_code_helper<1> { - enum { - single = 0, // LC = 1 => member length is 1 - sequence = 5 // LC = 5 => member length is also NEXTINT - }; -}; - -template <> -struct primitive_lc_code_helper<2> { - enum { - single = 1, // LC = 1 => member length is 2 - sequence = 4 // LC = 4 => member length is provided as an additional int - }; -}; - -template <> -struct primitive_lc_code_helper<4> { - enum { - single = 2, // LC = 2 => member length is 4 - sequence = 6 // LC = 6 => member length is 4 * NEXTINT - }; -}; - -template <> -struct primitive_lc_code_helper<8> { - enum { - single = 3, // LC = 3 => member length is 8 - sequence = 7 // LC = 7 => member length is 8 * NEXTINT - }; -}; - -template -struct primitive_lc_code { - enum { value = primitive_lc_code_helper::single }; -}; - -// In general, use LC = 5, for mutable aggregation types. Final aggregation -// types don't use this 'lc_code' trait type. The other cases are specialized -// after this. -template -struct lc_code { - static int value() - { - return 5; // LC = 5 => member length is provided in NEXTINT/ - } -}; - -// For collections of complex types and enums, if we serialize the DHeader -// (XCDR2 compliant behavior) we use LC = 5; if we don't (legacy RTI behavior) -// we use LC = 4, since we codify the length in the member header. -template -struct lc_code > { - static int value() - { - return is_dheader_required_in_non_primitive_collections() ? 5 : 4; - } -}; - -template -struct lc_code > { - static int value() - { - return is_dheader_required_in_non_primitive_collections() ? 5 : 4; - } -}; - -template -struct lc_code > { - static int value() - { - return is_dheader_required_in_non_primitive_collections() ? 5 : 4; - } -}; - -#if defined(RTI_FLAT_DATA_NO_EXCEPTIONS) - -// Traditional C++: no support for std::is_enum - -template -struct lc_code > { - static int value() - { - return primitive_lc_code_helper::sequence; - } -}; - -#else - -template -struct lc_code< - PrimitiveSequenceBuilder, - typename std::enable_if::value>::type> { - static int value() - { - return primitive_lc_code_helper::sequence; - } -}; - -template -struct lc_code< - PrimitiveSequenceBuilder, - typename std::enable_if::value>::type> { - static int value() - { - return is_dheader_required_in_enum_collections() - ? 5 - : primitive_lc_code_helper::sequence; - } -}; - -#endif - - -// -// Initialization of final types -// - -template -struct final_offset_initializer { - - static bool initialize(Offset& offset) - { - return RTI_XCDR_TRUE == RTIXCdrFlatData_initializeSample( - (char *) offset.get_buffer(), - offset.get_buffer_size(), - rti::xcdr::type_programs >::get()); - } - -}; - -// This will be specialized for enums in generated code (traditional C++) -// and for enum classes in FlatDataTraits.hpp (modern C++) -template -struct default_primitive_value { - static T get() - { - return (T) 0; - } -}; - -template -struct final_offset_initializer > { - - static bool initialize(rti::flat::PrimitiveArrayOffset& array) - { - T default_value = default_primitive_value::get(); - if (default_value == (T) 0) { // don't need to deal with endianness - memset(array.get_buffer(), 0, array.get_buffer_size()); - } else { - for (unsigned int i = 0; i < array.element_count(); i++) { - array.set_element(i, default_value); - } - } - return true; - } -}; - -template -struct final_offset_initializer > { - - static bool initialize(rti::flat::FinalAlignedArrayOffset& array) - { - for (unsigned int i = 0; i < N; i++) { - T offset = array.get_element(i); - if (offset.is_null()) { - return false; - } - - if (!final_offset_initializer::initialize(offset)) { - return false; - } - } - - return true; - } -}; - -} } } - -#endif // RTI_DDS_FLAT_BUILDERHELPER_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/ExceptionHelper.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/ExceptionHelper.hpp deleted file mode 100644 index 3a6013f6a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/ExceptionHelper.hpp +++ /dev/null @@ -1,179 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - - -#ifndef RTI_DDS_FLAT_EXCEPTIONHELPER_HPP_ -#define RTI_DDS_FLAT_EXCEPTIONHELPER_HPP_ - -// -// Enable debug assertions (RTI_FLAT_ASSERT) in debug mode -// -#if !defined(NDEBUG) -#define RTI_FLAT_DATA_ENABLE_DEBUG_ASSERTIONS -#endif - -// -// Error handling without C++ exceptions (traditional C++ and Micro C++ APIs) -// -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - // TODO: use MSG - #ifdef RTI_FLAT_DATA_ENABLE_DEBUG_ASSERTIONS - #define RTI_FLAT_ASSERT(COND, ACTION) \ - if (!(COND)) { \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, "Assertion failure: " #COND); \ - ACTION; \ - } - #else - #define RTI_FLAT_ASSERT(COND, ACTION) - #endif - - // CR decission: Log error messages. Export function for each log kind (serialize, deserialize, precondition, skip) - // pass type/field (if possible) to serialization errors - #define RTI_FLAT_OFFSET_CHECK_NOT_NULL(ACTION) \ - if (this->is_null()) { \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, "null offset"); \ - ACTION; \ - } - - #define RTI_FLAT_OFFSET_PRECONDITION_ERROR(MSG, ACTION) \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, MSG); \ - ACTION - - #define RTI_FLAT_CHECK_PRECONDITION(COND, ACTION) \ - if (!(COND)) { \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, "Precondition failure: " #COND); \ - ACTION; \ - } - - #define RTI_FLAT_BUILDER_CHECK_NOT_BOUND(ACTION) \ - if (this->bind_position_) { \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, "Builder is currently bound - call finish() first"); \ - ACTION; \ - } - - #define RTI_FLAT_BUILDER_CHECK_CAN_FINISH(ACTION) \ - if (!this->is_nested()) { \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, "This is not a member builder; call finish_sample() instead"); \ - ACTION; \ - } - - #define RTI_FLAT_BUILDER_CHECK_CAN_FINISH_SAMPLE(ACTION) \ - if (this->is_nested()) { \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, "This is a member builder; call finish() instead"); \ - ACTION; \ - } - - #define RTI_FLAT_BUILDER_CHECK_VALID(ACTION) \ - if (!this->is_valid()) { \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, "This Builder is not valid"); \ - ACTION; \ - } - - #define RTI_FLAT_BUILDER_CHECK_CREATE_BUILDER(BUILDER, ACTION) \ - if (!BUILDER.is_valid()) { \ - this->set_failure(); \ - RTIXCdrFlatData_logCreationError(__FILE__, __LINE__, "Builder"); \ - ACTION; \ - } - - #define RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(ACTION) \ - this->set_failure(); \ - RTIXCdrFlatData_logBuilderOutOfResources(__FILE__, __LINE__); \ - ACTION - - #define RTI_FLAT_BUILDER_PRECONDITION_ERROR(MSG, ACTION) \ - this->set_failure(); \ - RTIXCdrFlatData_logPreconditionError(__FILE__, __LINE__, MSG); \ - ACTION - -// -// Error handling with C++ exceptions (modern C++ API) -// -#else // !RTI_FLAT_DATA_NO_EXCEPTIONS - - #ifdef RTI_FLAT_DATA_ENABLE_DEBUG_ASSERTIONS - #define RTI_FLAT_ASSERT(COND, ACTION) \ - if (!(COND)) throw dds::core::PreconditionNotMetError("Assertion failure: " #COND) - #else - #define RTI_FLAT_ASSERT(COND, ACTION) - #endif - - #define RTI_FLAT_OFFSET_CHECK_NOT_NULL(ACTION) \ - if (this->is_null()) throw dds::core::NullReferenceError("null offset") - - #define RTI_FLAT_OFFSET_PRECONDITION_ERROR(MSG, ACTION) \ - throw dds::core::PreconditionNotMetError(MSG) - - #define RTI_FLAT_CHECK_PRECONDITION(COND, ACTION) \ - if (!(COND)) throw dds::core::PreconditionNotMetError("Precondition failure: " #COND) - - #define RTI_FLAT_BUILDER_CHECK_NOT_BOUND(ACTION) \ - if (bind_position_) \ - throw dds::core::PreconditionNotMetError( \ - "Builder is currently bound - call finish() first") - - #define RTI_FLAT_BUILDER_CHECK_CAN_FINISH(ACTION) \ - if (!is_nested()) \ - throw dds::core::PreconditionNotMetError( \ - "This is not a member builder; call finish_sample() instead") - - #define RTI_FLAT_BUILDER_CHECK_CAN_FINISH_SAMPLE(ACTION) \ - if (is_nested()) \ - throw dds::core::PreconditionNotMetError( \ - "This is a member builder; call finish() instead") - - #define RTI_FLAT_BUILDER_CHECK_VALID(ACTION) \ - if (!is_valid()) \ - throw dds::core::PreconditionNotMetError("This Builder is not valid") - - // With exceptions, nothing to check (exception would have been thrown) - #define RTI_FLAT_BUILDER_CHECK_CREATE_BUILDER(BUILDER, ACTION) - - #define RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(ACTION) \ - throw dds::core::OutOfResourcesError("builder reached end of buffer") - - #define RTI_FLAT_BUILDER_PRECONDITION_ERROR(MSG, ACTION) \ - throw dds::core::PreconditionNotMetError(MSG) - - -#endif // RTI_FLAT_DATA_NO_EXCEPTIONS - -// -// Error checking (other than assertions) in release mode is enabled unless -// the sources are compiled with -DRTI_FLAT_DATA_DISABLE_ERROR_CHECKING -// -// In that case, most error checks that deal with preconditions due to incorrect -// usage of the API are disabled in release mode. This would lead to undefined -// behavior in case of bad usage, but can improve performance. -// -#if defined(RTI_FLAT_DATA_ENABLE_DEBUG_ASSERTIONS) \ - || !defined(RTI_FLAT_DATA_DISABLE_ERROR_CHECKING) -#define RTI_FLAT_DATA_ENABLE_ERROR_CHECKING -#endif - -#ifndef RTI_FLAT_DATA_ENABLE_ERROR_CHECKING - - #define RTI_FLAT_OFFSET_CHECK_NOT_NULL(ACTION) - #define RTI_FLAT_ASSERT(COND, ACTION) - #define RTI_FLAT_CHECK_PRECONDITION(COND, ACTION) - #define RTI_FLAT_BUILDER_CHECK_NOT_BOUND(ACTION) - #define RTI_FLAT_BUILDER_CHECK_CAN_FINISH(ACTION) - #define RTI_FLAT_BUILDER_CHECK_CAN_FINISH_SAMPLE(ACTION) - #define RTI_FLAT_BUILDER_CHECK_VALID(ACTION) - #define RTI_FLAT_BUILDER_CHECK_CREATE_BUILDER(BUILDER, ACTION) - -#endif // RTI_FLAT_DATA_ENABLE_ERROR_CHECKING - -namespace rti { namespace flat { namespace detail { - -} } } - -#endif // RTI_DDS_FLAT_EXCEPTIONHELPER_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSample.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSample.hpp deleted file mode 100644 index 06cc56062..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSample.hpp +++ /dev/null @@ -1,451 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_FLATSAMPLE_HPP_ -#define RTI_DDS_FLAT_FLATSAMPLE_HPP_ - -// Note: FlatSampleImpl.hpp needs to be included in addition to this header. - -#include -#include - -#include "xcdr/xcdr_stream_impl.h" -#include "xcdr/xcdr_flat_data.h" -#include "xcdr/xcdr_interpreter.h" - -#include "rti/xcdr/Interpreter.hpp" // for type_programs - -/** - * @defgroup RTIFlatSampleModule FlatData Samples - * @ingroup RTIFlatDataModule - * @brief A Sample represents an instance of the IDL topic-type and contains - * the data in serialized format. - * - * All FlatData topic-types are instantiations of rti::flat::Sample. - * This documentation uses the following three example types to illustrate the - * different ways FlatData IDL types map to C++: - * - \ref MyFlatFinal, the type generated for a final IDL struct - * - \ref MyFlatMutable, the type generated for a mutable IDL struct - * - \ref MyFlatUnion, the type generated for an IDL union - */ - -namespace rti { namespace flat { - -struct fixed_size_type_tag_t {}; -struct variable_size_type_tag_t {}; - -typedef RTIXCdrUnsignedLong offset_t; -typedef RTIXCdrUnsignedLong member_id_t; - -// The untemplated base of Sample -class SampleBase { -public: - - unsigned char* get_buffer() - { - return &data[0]; - } - - const unsigned char* get_buffer() const - { - return &data[0]; - } - - unsigned char* get_root_buffer() - { - return get_buffer() + RTI_XCDR_ENCAPSULATION_SIZE; - } - - /*i - * @brief Provides the address of the top-level type - */ - const unsigned char* get_root_buffer() const - { - return get_buffer() + RTI_XCDR_ENCAPSULATION_SIZE; - } - - void initialize_stream( - RTIXCdrStream& stream, - offset_t offset, - offset_t serialized_size) const - { - RTIXCdrFlatData_initializeStream( - &stream, - const_cast(get_buffer()), - offset, - serialized_size); - } - -protected: // xlc compiler fails when the default constructor is private -#if !defined(RTI_FLAT_DATA_CXX11_DELETED_FUNCTIONS) - SampleBase() {} // Samples can only be created via Sample::create_data - SampleBase(const SampleBase&) {} - SampleBase& operator=(const SampleBase&); -#else - SampleBase() = delete; - SampleBase(const SampleBase&) = delete; - SampleBase& operator=(const SampleBase&) = delete; -#endif - - // The actual size of data (and therefore, the Sample object) is variable, - // and equal to the serialized size of the IDL Sample - unsigned char data[1]; -}; - -/** - * @ingroup RTIFlatSampleModule - * @brief The generic definition of FlatData topic-types - * - * @tparam OffsetType The Offset to the beginning of the data Sample (the root), - * for example MyFlatFinalOffset, or MyFlatMutableOffset. - * - * For a FlatData IDL type, \nddsgen generates an instantiation of this class, - * such as MyFlatFinal or MyFlatMutable. That's the topic-type used to - * declare a \idref_Topic and write or read FlatData samples. - * - * A FlatData Sample owns an inline buffer that contains the serialized data. - * To access the Sample data members we use \ref RTIFlatOffsetsModule "Offsets", - * iterators that point to the position of a member in the Sample buffer. The - * root() is the Offset to the top-level element (for example MyFlatMutableOffset). - * From there MyFlatMutableOffset's member functions provide access to its - * members. - * - * The method to create a Sample varies depending on whether the type is final - * or mutable. - * - * Samples of final FlatData types always have the same size, and - * can be obtained directly with \idref_FooDataWriter_get_loan(). - * - * Samples of mutable FlatData types need to be "built" using the Builder - * returned by rti::flat::build_data() (MyFlatMutableBuilder in this example). - * A Builder allows adding each member individually in any order, and sizing - * sequences as needed. - * - * See \ref PublishingFlatData for code snippets. - * - * Samples created with \idref_FooDataWriter_get_loan() or rti::flat::build_data() - * are DataWriter-managed and do not need to be explicitly deleted. See - * \idref_FooDataWriter_get_loan() for an explanation of the lifecycle of - * DataWriter-managed samples. - * - * Samples received with a \idref_FooDataReader can be examined by obtaining the - * root(), but cannot be modified. See \ref SubscribingFlatData. - * - * FlatData samples are not value types. They don't provide copy constructors - * or assignment operators, because of their definition as an inline buffer that - * contains the serialized Sample at all times. A Sample can be cloned with - * the static function clone(). A cloned Sample is unmanaged and has to be - * deleted with the static function delete_data(). - */ -template -class Sample : public SampleBase { -public: - /** - * @brief The related Offset type - * - * This is the template parameter, OffsetType - */ - typedef OffsetType Offset; - - /** - * @brief The related read-only Offset type - * - * For example, MyFlatMutableOffset::ConstOffset. - */ - typedef typename OffsetType::ConstOffset ConstOffset; - - /** - * @brief Provides the Offset to the top-level type - * - * @return An Offset that allows reading and modifying the members of this - * Sample, for example MyFlatFinalOffset or MyFlatMutableOffset. - * - * This overload allows modifying the Sample. - * - * Example: - * \code - * MyFlatFinal *my_sample = ...; // for example, created with DataWriter::get_loan() - * MyFlatFinalOffset my_sample_root = my_sample->root(); - * my_sample_root.my_primitive(33); - * auto my_member_offset = my_sample_root.my_complex(); - * // ... modify my_member_offset - * \endcode - */ - Offset root() - { - return root_impl(typename Offset::offset_kind()); - } - - /** - * @brief Provides the Offset to the top-level type - * - * @return An Offset that allows reading the members of this Sample. - * For example, MyFlatFinalOffset::ConstOffset or MyFlatMutableOffset::ConstOffset. - * - * This overload doesn't allow modifying the Sample. - * - * Example: - * \code - * const MyFlatMutable *my_sample = ...; // for example, read from a DataReader - * MyFlatMutableOffset::ConstOffset my_sample_root = my_sample->root(); - * std::cout << my_sample_root.my_primitive() << std::endl; - * auto my_member_offset = my_sample_root.my_mutable_seq(); - * // ... read my_member_offset - * \endcode - */ - ConstOffset root() const - { - return root_impl(typename ConstOffset::offset_kind()); - } - - /** @private - * @brief Returns the endianness in which this Sample is serialized - */ - RTIXCdrEndian endian() const - { - RTIXCdrStream tmp_stream; - initialize_stream(tmp_stream, 0, RTI_XCDR_ENCAPSULATION_SIZE); - return tmp_stream._endian; - } - - /** @private - * @brief Casts a byte buffer into a Sample of this type - */ - static Sample* from_buffer(unsigned char *buffer) - { - return reinterpret_cast*>(buffer); - } - - /** - * @brief Creates an unmanaged FlatData Sample - * - * @note In general on the publication side it is recommended to create - * DataWriter-managed samples using \idref_FooDataWriter_get_loan - * (for final types) and rti::flat::build_data() (for mutable types). - * - * If the topic-type is final, the returned Sample can be initialized - * by obtaining the root(). - * - * If the topic-type is mutable, the resulting Sample has no members, and - * root() returns a \ref rti::flat::OffsetBase::is_null "null" Offset. - * The result of create_data() must be used to - * create a Builder. This is a rare use case, and rti::flat::build_data() - * should be used in most situations. - * - * In all cases, the returned Sample must be explicitly deleted with - * delete_data(). - */ - static Sample* create_data(); // impl in FlatSampleImpl.hpp - - /** - * @brief Clones a Sample, creating an unmanaged Sample - * - * @warning When this Sample has been created with \idref_FooDataWriter_get_loan - * or rti::flat::build_data(), the clone this function creates cannot be - * used in \idref_FooDataWriter_write, because the DataWriter is managing - * the lifecycle of its samples. - * - * Creates a new Sample and copies the underlying serialized buffer. - * - * delete_data() must be called to release the Sample. - */ - Sample* clone() const - { - unsigned char *buffer = RTIXCdrFlatData_cloneSample( - get_buffer(), - sample_size()); - - if (buffer == NULL) { - #ifndef RTI_FLAT_DATA_NO_EXCEPTIONS - throw std::bad_alloc(); - #else - return NULL; - #endif - } - - return reinterpret_cast *>(buffer); - } - - /** - * @brief Releases an unmanaged Sample - * - * Unmanaged samples are those created with create_data() or clone(). - * - * @pre \p sample cannot have been created with \idref_FooDataWriter_get_loan - * or rti::flat::build_data(). - * - * @post \p sample becomes invalid and shouldn't be used - */ - static void delete_data(rti::flat::Sample* sample) - { - RTIXCdrFlatData_deleteSample(sample); - } - - /** @private - */ - offset_t buffer_size() const - { - return sample_size() + RTI_XCDR_ENCAPSULATION_SIZE; - } - - /** @private - */ - offset_t sample_size() const - { - return sample_size_impl(typename OffsetType::offset_kind()); - } - -private: - offset_t sample_size_impl(fixed_size_type_tag_t) const - { - return OffsetType::serialized_size(0); - } - - offset_t sample_size_impl(variable_size_type_tag_t) const - { - return RTIXCdrFlatSample_getMutableSampleSize( - get_buffer(), - RTI_XCDR_ENCAPSULATION_SIZE); - } - - Offset root_impl(fixed_size_type_tag_t) - { - return Offset(this, RTI_XCDR_ENCAPSULATION_SIZE); - } - - Offset root_impl(variable_size_type_tag_t) - { - return Offset(this, RTI_XCDR_ENCAPSULATION_SIZE, sample_size()); - } - - ConstOffset root_impl(fixed_size_type_tag_t) const - { - return ConstOffset(this, RTI_XCDR_ENCAPSULATION_SIZE); - } - - ConstOffset root_impl(variable_size_type_tag_t) const - { - return ConstOffset(this, RTI_XCDR_ENCAPSULATION_SIZE, sample_size()); - } -}; - -template -struct flat_type_traits; - -} } - -#ifdef DOXYGEN_DOCUMENTATION_ONLY - -/** - * @ingroup RTIFlatSampleModule - * @brief Represents an arbitrary user-defined FlatData final IDL struct - * - * This documentation uses the following example IDL definition of MyFlatFinal: - * - * \code - * @language_binding(FLAT_DATA) - * @final - * struct MyFlatFinal { - * long my_primitive; - * FlatFinalBar my_complex; // Another arbitrary final FlatData type - * long my_primitive_array[10]; - * FlatFinalBar my_complex_array[10]; - * }; - * \endcode - * - * For this type, \nddsgen generates: - * - MyFlatFinal (this instantiation of Sample), - * - MyFlatFinalOffset. - * - * Note that, as a final FlatData type, MyFlatFinal can only contain - * fixed-size types, such as primitives, other final FlatData structs, and arrays - * of fixed-size types. - * - * Samples of MyFlatFinal are created with \idref_FooDataWriter_get_loan. - * After creating a final Sample, modify its values using the MyFlatFinalOffset - * returned by \ref rti::flat::Sample::root "root()". - */ -typedef rti::flat::Sample MyFlatFinal; - -/** - * @ingroup RTIFlatSampleModule - * @brief Represents an arbitrary user-defined flat mutable IDL struct - * - * This documentation uses the following example IDL definition of MyFlatMutable: - * - * \code - * @language_binding(FLAT_DATA) - * @mutable - * struct MyFlatMutable { - * long my_primitive; - * @optional long my_optional_primitive; - * long my_primitive_array[10]; - * sequence my_primitive_seq; - * - * MyFlatFinal my_final; - * MyFlatFinal my_final_array[10]; - * sequence my_final_seq; - * - * FlatMutableBar my_mutable; - * FlatMutableBar my_mutable_array[10]; - * sequence my_mutable_seq; - * - * string<255> my_string; - * sequence, 10> my_string_seq; - * }; - * \endcode - * - * For this type, \nddsgen generates: - * - MyFlatMutable (this instantiation of Sample), - * - MyFlatMutableOffset, - * - MyFlatMutableBuilder. - * - * As a mutable FlatData type, MyFlatMutable is not restricted to fixed-size - * members. Samples of MyFlatMutable are created with rti::flat::build_data(), which - * returns a MyFlatMutableBuilder. Once built, a mutable Sample can't change - * in size, but the value of members that already exist can be changed using - * the MyFlatMutableOffset returned by \ref rti::flat::Sample::root "root()". - */ -typedef rti::flat::Sample MyFlatMutable; - -/** - * @ingroup RTIFlatSampleModule - * @brief Represents an arbitrary user-defined flat mutable IDL union - * - * This documentation uses the following example IDL definition of MyFlatUnion: - * - * \code - * @language_binding(FLAT_DATA) - * @mutable - * union MyFlatUnion switch (long) { - * case 0: - * long my_primitive; - * case 1: - * case 2: - * MyFlatMutable my_mutable; - * case 3: - * MyFlatFinal my_final; - * }; - * \endcode - * - * @note FlatData unions can only be mutable since unions are, - * by definition, variable-size types. - * - * For this type, \nddsgen generates: - * - MyFlatUnion (this instantiation of Sample), - * - MyFlatUnionOffset, - * - MyFlatUnionBuilder. - * - */ -typedef rti::flat::Sample MyFlatUnion; -#endif - -#endif // RTI_DDS_FLAT_FLATSAMPLE_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSampleImpl.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSampleImpl.hpp deleted file mode 100644 index 5f3ccb1fd..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatSampleImpl.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_FLATSAMPLEIMPL_HPP_ -#define RTI_DDS_FLAT_FLATSAMPLEIMPL_HPP_ - -// This file includes the implementation of some templates that need to -// appear after some types are defined in the generated code. This is a -// a restriction on some platforms such as pentiumInty11.pcx64 and other Intys, -// sparcSol2.10gcc3.4.2. - -// For example, type_programs needs to be defined (as an specialization -// for T) before its used in create_data(). - -#include "rti/flat/FlatSample.hpp" - -namespace rti { namespace flat { - -namespace detail { - -template -Sample* create_data_impl(fixed_size_type_tag_t) -{ - unsigned char *buffer = RTIXCdrFlatData_createSampleFinal( - OffsetType::serialized_size(0), - rti::xcdr::type_programs >::get()); - - if (buffer == NULL) { - #ifndef RTI_FLAT_DATA_NO_EXCEPTIONS - throw std::bad_alloc(); - #else - return NULL; - #endif - } - - return reinterpret_cast *>(buffer); -} - -template -Sample* create_data_impl(variable_size_type_tag_t) -{ - unsigned char *buffer = RTIXCdrFlatData_createSampleMutable( - rti::xcdr::type_programs >::get()); - - if (buffer == NULL) { - #ifndef RTI_FLAT_DATA_NO_EXCEPTIONS - throw std::bad_alloc(); - #else - return NULL; - #endif - } - - return reinterpret_cast *>(buffer); -} - -} - -// Declared in FlatSample.hpp -template -Sample* Sample::create_data() -{ - return detail::create_data_impl( - typename OffsetType::offset_kind()); -} - -} } - -#endif // RTI_DDS_FLAT_FLATSAMPLEIMPL_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatTypeTraits.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatTypeTraits.hpp deleted file mode 100644 index 642c50185..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/FlatTypeTraits.hpp +++ /dev/null @@ -1,264 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_FLATTYPETRAITS_HPP_ -#define RTI_DDS_FLAT_FLATTYPETRAITS_HPP_ - -#include "rti/flat/Offset.hpp" -#include "rti/flat/SequenceOffsets.hpp" -#include "rti/flat/AggregationBuilders.hpp" - -namespace rti { namespace flat { - - -/** - * @ingroup RTIFlatSampleModule - * @brief Given a Sample, an Offset or a Builder, it allows obtaining the other types. - * - * @tparam T One of the following: - * \li A Sample type, such as \ref MyFlatMutable - * \li An Offset type, such as MyFlatMutableOffset - * \li A Builder type, such as MyFlatMutableBuilder - * - *

Given \p T, this type provides the following typedefs: - * \li \p flat_type_traits::offset, T's related offset type - * (undefined if T itself is an Offset) - * \li \p flat_type_traits::builder, T's related builder type - * (undefined if T itself is a Builder, or the topic-type is not mutable) - * \li \p flat_type_traits::flat_type, T's related Sample type - * (undefined if T itself is a Sample type) - * \li \p flat_type_traits::plain_type, T's equivalent definition as a plain - * (non-FlatData) type. - * - * For example, for \p T = \ref MyFlatMutable, flat_type_traits is defined as follows: - * - * \code - * template <> - * struct flat_type_traits { - * typedef MyFlatMutablePlainHelper plain_type; - * typedef MyFlatMutableOffset offset; - * typedef MyFlatMutableBuilder builder; - * }; - * \endcode - * - * Or if \p T = MyFlatMutableOffset: - * - * \code - * template <> - * struct flat_type_traits { - * typedef MyFlatMutable flat_type; - * typedef MyFlatMutablePlainHelper plain_type; - * typedef MyFlatMutableBuilder builder; - * }; - * \endcode - * - * @see rti::flat::plain_cast() - */ -// For aggregation types, this template is to be specialized in generated code -template -struct flat_type_traits; - -template -struct flat_type_traits > { - typedef typename flat_type_traits::plain_type plain_type; -}; - -template -struct flat_type_traits > { - typedef T plain_type; -}; - -template -struct flat_type_traits > { - typedef T plain_type; -}; - -template -struct flat_type_traits > { - typedef typename flat_type_traits::plain_type plain_type; -}; - -template -struct flat_type_traits > { - typedef typename flat_type_traits::plain_type plain_type; -}; - -template -struct flat_type_traits > { - typedef typename flat_type_traits::plain_type plain_type; -}; - -template <> -struct flat_type_traits : - flat_type_traits > { -}; - -template -struct flat_type_traits > { - typedef T plain_type; -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Casts into an equivalent plain C++ type - * - * Some FlatData types can be cast to their equivalent plain definition as - * a regular non-FlatData C++ type. This is a more efficient way to access - * the data. This function casts, if possible, the member pointed to by the - * offset argument to an equivalent plain C++ type. Any changes made through - * the plain type are reflected in the FlatData sample. - * - * @tparam OffsetType The Offset type - * - * @pre plain_cast requires the type to meet the following restrictions: - * - The type must be a final struct, or an array or sequence of members of a - * type that meets these restrictions (including primitive types) - * - The type must be defined in a way such that the packing of the plain C++ type - * doesn't differ from the padding in XCDR2. - * - The type may not inherit from another type. - * - In addition, the sample must be serialized in the native endianness. - * For example, if a subscribing application on a little-endian platform - * receives a sample published from a big-endian system, it is not possible - * to plain_cast the sample or any of its members, except if the member is a - * primitive array or sequence of 1-byte elements. - * - * \ref rti::flat::OffsetBase::is_cpp_compatible "offset.is_cpp_compatible()" - * indicates if the member meets the requirements. If the type doesn't, this - * function \if CPP2_LANGUAGE_ONLY throws dds::core::PreconditionNotMetError. - * \else returns NULL. \endif - * - * @param offset The offset to the member to cast. - * @return The data that \p offset referred to, cast as a plain C++ type with the - * same definition. If \p offset is an array or sequence member, the returned pointer - * represents a C++ array with the same number of elements. - * - * The following table summarizes the possible parameters to this function (assuming - * that they meet the previous requirements), and the return type in each case: - * - * | \p OffsetType | return type - * | ------------- | ----------- - * | Offset to a final struct, such as `MyFlatFinalOffset` | `MyFlatFinalPlainHelper*` (pointer to a single element). This is a type with the same IDL definition, but without `@language_binding(FLAT_DATA)`. - * | Offset to an array of final structs, such as `FinalArrayOffset` | `MyFlatFinalPlainHelper*` (array of `N` elements) - * | Offset to a sequence of final structs, such as `SequenceOffset` | `MyFlatFinalPlainHelper*` (array of `offset.element_count()` elements) - * | Offset to an array of primitive types, such as `PrimitiveArrayOffset` | `int32_t*` (array of `N` elements) - * | Offset to a sequence of primitive types, such as `PrimitiveSequenceOffset` | `int32_t*` (array of `offset.element_count()` elements) - * - * - * Due to the performance advantages that \p plain_cast offers, it is recommended - * to define FlatData types in a way that their largest member(s) can be - * \p plain_cast. - * - * The following example shows how to use \p plain_cast to cast a MyFlatFinalOffset - * into the type with the same IDL definition as \ref MyFlatFinal, but without - * the \p \@language_binding(FLAT_DATA) annotation: - * - * \code - * MyFlatMutable *my_sample = ...; - * auto my_root = my_sample->root(); - * auto my_final = my_root.my_final(); - * - * // Get the plain C++ type and modify an array - * auto my_final_plain = rti::flat::plain_cast(my_final); - * my_final_plain->my_primitive(3); // this is using the plain C++ setter - * my_final_plain->my_complex_array()[1].x(20); // this is a std::array - * - * // The change to my_complex_array is reflected in the FlatData sample - * std::cout << my_final.my_primitive() << std::endl; // 3 - * std::cout << my_final.my_complex_array().get_element(1).x() << std::endl; // 20 - * \endcode - * - * This example shows how to use plain_cast to efficiently build a sequence - * of final elements and a sequence of integers, both members of a mutable type: - * - * \code - * MyFlatMutableBuilder builder = rti::flat::build_data(writer); - * - * // 1) - * // - * // Build a sequence of 5 elements with add_n() instead of 5 calls to - * // add_next() - * rti::flat::FinalSequenceBuilder seq_builder = - * builder.build_my_final_seq(); - * seq_builder.add_n(5); - * // Finish the member, getting the offset to the member - * rti::flat::SequenceOffset seq_offset = seq_builder.finish(); - * - * // Cast it to an array of plain C++ type and initialize it. - * // This way to initialize it is more efficient than add_next(). - * auto seq_elements = rti::flat::plain_cast(seq_offset); - * for (int i = 0; i < 5; i++) { - * seq_elements[i].my_primitive(i); - * // ... - * } - * - * // 2) - * // - * // Build a sequence of 1000 integers - * auto seq_builder = builder.build_my_primitive_seq(); - * // make space for 1000 elements, but leave them uninitialized - * seq_builder.add_n(1000); - * auto seq_offset = seq_builder.finish(); - * - * // Initialize the elements: - * int32_t *elements = rti::flat::plain_cast(seq_offset); - * for (int i = 0; i < 1000; i++) { - * elements[i] = ...; - * } - * - * // ... continue building the sample using 'builder' - * \endcode - * - */ -template -typename flat_type_traits::plain_type* plain_cast(OffsetType& offset) -{ - RTI_FLAT_CHECK_PRECONDITION(offset.is_cpp_compatible(), return NULL); - return reinterpret_cast::plain_type*>( - offset.get_buffer()); -} - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Const version of plain_cast - */ -template -const typename flat_type_traits::plain_type* plain_cast(const OffsetType& offset) -{ - RTI_FLAT_CHECK_PRECONDITION(offset.is_cpp_compatible(), return NULL); - return reinterpret_cast::plain_type*>( - offset.get_buffer()); -} - -namespace detail { - -template -struct offset_kind_is_fixed_size { - enum { value = 0 }; -}; - -template <> -struct offset_kind_is_fixed_size { - enum { value = 1 }; -}; - -} - -// Utility to determine if a Flat Data type is fixed size (final) or variable -// size (mutable) -template -struct is_fixed_size_type - : detail::offset_kind_is_fixed_size -{ -}; - -} } - -#endif // RTI_DDS_FLAT_FLATSAMPLE_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/Offset.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/Offset.hpp deleted file mode 100644 index 2c2d2ded5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/Offset.hpp +++ /dev/null @@ -1,1203 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_FLATOFFSETS_HPP_ -#define RTI_DDS_FLAT_FLATOFFSETS_HPP_ - -#include "xcdr/xcdr_stream.h" -#include "xcdr/xcdr_stream_impl.h" -#include "xcdr/xcdr_interpreter.h" - -#include "rti/xcdr/Stream.hpp" - -/** - * @defgroup RTIFlatOffsetsModule FlatData Offsets - * @ingroup RTIFlatDataModule - * @brief Offsets provide access to the members of a FlatData Sample - * - * An Offset represents a position within a - * \ref RTIFlatSampleModule "FlatData Sample" that allows accessing a member - * of that Sample, or the Sample's \ref rti::flat::Sample::root "root". - * - * Offsets can be described as iterators. They represent a position in a - * buffer, not the value itself. As such, they're lightweight objects that can - * be copied to point to the same data. - * - * There are the following Offset types to access the different IDL types: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
CategoryOffset type
User types For example:
    - *
  • MyFlatFinalOffset, an Offset to a final struct
  • - *
  • MyFlatMutableOffset, an Offset to a mutable struct
  • - *
  • MyFlatUnionOffset, an Offset to a union
  • - *
Arrays
    - *
  • rti::flat::PrimitiveArrayOffset
  • - *
  • rti::flat::FinalArrayOffset (array of final elements in a final type)
  • - *
  • rti::flat::FinalAlignedArrayOffset (array of final elements in a mutable type)
  • - *
  • rti::flat::MutableArrayOffset
  • - *
Sequences
    - *
  • rti::flat::PrimitiveSequenceOffset
  • - *
  • rti::flat::SequenceOffset
  • - *
Primitive types
    - *
  • The type itself, such as \p double
  • - *
  • rti::flat::PrimitiveOffset (when the member is optional)
  • - *
- * - * Offsets for user types are generated by \nddsgen and provide methods to - * access the type's members by their names. Offsets for arrays and sequences - * provide methods to access each element. - * - * Some offsets allow accessing the data through a pointer to the equivalent plain - * C++ type, which generally provides better performance. See rti::flat::plain_cast(). - * - * @section OffsetErrorManagement Offset Error Management - * Functions that return an Offset may return a "null" Offset (one such that - * \ref rti::flat::OffsetBase::is_null "is_null()" returns \p true). - * - * An Offset may be null if a member doesn't exist in the \ref - * RTIFlatSampleModule "Sample". For example, if the member 'my_final' in - * \ref MyFlatMutable doesn't exist (because it wasn't added while building the - * Sample, or because it wasn't received in the subscribing application), - * MyFlatMutableOffset::my_final() returns an null Offset. Note that a - * member in a final type (for example, MyFlatFinalOffset::my_complex()) - * always exists, except in the case of an error. - * - * \if CPP_LANGUAGE_ONLY - * In addition to that, a function may return a null Offset for any error - * condition. - * \endif - * - * \if CPP2_LANGUAGE_ONLY - * Other than that, any error condition will cause one of the following - * exceptions, not a null Offset: - * - dds::core::NullReferenceError, when accessing a null Offset - * - dds::core::PreconditionNotMetError, for any precondition failure. - * - dds::core::OutOfResourcesError, when a \ref RTIFlatBuildersModule "Builder" - * runs out of space while adding a member. - * \endif - * - */ - -#ifdef DOXYGEN_DOCUMENTATION_ONLY - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Represents the Offset to an arbitrary user-defined FlatData final - * IDL struct - * - * This example type represents the Offset type that \nddsgen would generate - * for \ref MyFlatFinal. - * - * It provides accessors for each of its members. Accessors can return other - * Offsets or primitive values. - * - * An Offset to a final type may meet the requirements to be cast to its - * equivalent plain C++ type (see rti::flat::plain_cast()). - * - */ -class MyFlatFinalOffset : public rti::flat::FinalOffset { - public: - /** - * @brief The equivalent read-only Offset type - * - * Each Offset for a user type has an equivalent const Offset that doesn't - * provide the methods to modify the Sample. \if CPP2_LANGUAGE_ONLY - * For example, when reading data from a \idref_DataReader, a const Sample's - * Sample::root() function returns a const Offset.\endif - */ - typedef MyFlatFinalConstOffset ConstOffset; - - /** - * @brief Creates a null Offset - * - * @post is_null() - */ - MyFlatFinalOffset() - { - } - - /** - * @brief Retrieves the value for a primitive member - */ - int32_t my_primitive() const; - - /** - * @brief Retrieves a const Offset to a complex member - * - * FlatFinalBar is another arbitrary user-defined final FlatData type. - */ - FlatFinalBar::ConstOffset my_complex() const; - - /** - * @brief Retrieves a const Offset to a primitive array - */ - const rti::flat::PrimitiveArrayOffset my_primitive_array() const; - - /** - * @brief Retrieves a const Offset to a complex array - */ - rti::flat::FinalArrayOffset my_complex_array() const; - - /** - * @brief Sets the value for a primitive member - */ - bool my_primitive(int32_t value); - - /** - * @brief Retrieves a non-const Offset to a complex member - * - * FlatFinalBar is another arbitrary user-defined final FlatData type. - */ - FlatFinalBar::Offset my_complex(); - - /** - * @brief Retrieves a non-const Offset to a primitive array - */ - rti::flat::PrimitiveArrayOffset my_primitive_array(); - - /** - * @brief Retrieves a non-const Offset to a complex array - */ - rti::flat::FinalArrayOffset my_complex_array(); -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Represents the Offset to an arbitrary user-defined FlatData - * mutable IDL struct - * - * This example type represents the Offset type that \nddsgen would generate - * for \ref MyFlatMutable. - * - * It provides accessors for each of its members. Accessors can return other - * Offsets or primitive values. - * - */ -class NDDSUSERDllExport MyFlatMutableOffset : public rti::flat::MutableOffset { - public: - /** - * @brief The equivalent read-only Offset type - * - * Each Offset for a user type has an equivalent const Offset that doesn't - * allow modifying the underlying Sample. \if CPP2_LANGUAGE_ONLY - * For example, when reading data from a \idref_DataReader, a const Sample's - * Sample::root() function returns a const Offset.\endif - */ - typedef MyFlatMutableConstOffset ConstOffset; - - /** - * @brief Creates a null Offset - * - * @post is_null() - */ - MyFlatMutableOffset() - { - } - - /** - * @brief Retrieves the value for a primitive member - * - * @return The value of the member or its default value if this member - * doesn't exist in this Sample. - */ - int32_t my_primitive() const; - - /** - * @brief Retrieves a const Offset to an optional primitive - * - * Unlike the non-optional my_primitive(), which accesses the integer - * directly, for an optional primitive it is possible to check whether it - * exists or not. If it doesn't exist, the Offset this function returns - * will be null (\p is_null()). - */ - rti::flat::PrimitiveConstOffset my_optional_primitive() const; - - /** - * @brief Retrieves a const Offset to a primitive array - */ - const rti::flat::PrimitiveArrayOffset my_primitive_array() const; - - /** - * @brief Retrieves a const Offset to a primitive sequence - */ - const rti::flat::PrimitiveSequenceOffset my_primitive_seq() const; - - /** - * @brief Retrieves a const Offset to a complex member - */ - MyFlatFinal::ConstOffset my_final() const; - - /** - * @brief Retrieves a const Offset to a complex array - */ - rti::flat::FinalAlignedArrayOffset my_final_array() const; - - /** - * @brief Retrieves a const Offset to a complex sequence - */ - rti::flat::SequenceOffset my_final_seq() const; - - /** - * @brief Retrieves a const Offset to a complex member - * - * FlatMutableBar is another arbitrary user-defined mutable FlatData type. - */ - FlatMutableBar::ConstOffset my_mutable() const; - - /** - * @brief Retrieves a const Offset to a complex array - */ - rti::flat::MutableArrayOffset my_mutable_array() const; - - /** - * @brief Retrieves a const Offset to a complex sequence - */ - rti::flat::SequenceOffset my_mutable_seq() const; - - /** - * @brief Retrieves a const Offset to a string - */ - const rti::flat::StringOffset my_string() const; - - /** - * @brief Retrieves a const Offset to a sequence of strings - */ - rti::flat::SequenceOffset my_string_seq() const; - - /** - * @brief Sets the value of a primitive member - */ - bool my_primitive(int32_t value); - - /* @brief Retrieves a non-const Offset to an optional primitive - * - * Unlike the non-optional my_primitive(), which allows accessing the integer - * directly, an optional primitive may not exist. If it doesn't, the Offset - * this function returns will be null (\p is_null()). - */ - rti::flat::PrimitiveOffset my_optional_primitive(); - - /** - * @brief Retrieves a non-const Offset to a primitive array - */ - rti::flat::PrimitiveArrayOffset my_primitive_array(); - - /** - * @brief Retrieves a non-const Offset to a primitive sequence - */ - rti::flat::PrimitiveSequenceOffset my_primitive_seq(); - - /** - * @brief Retrieves a non-const Offset to a complex member - */ - MyFlatFinal::Offset my_final(); - - /** - * @brief Retrieves a non-const Offset to a complex array - */ - rti::flat::FinalAlignedArrayOffset my_final_array(); - - /** - * @brief Retrieves a non-const Offset to a complex sequence - */ - rti::flat::SequenceOffset my_final_seq(); - - /** - * @brief Retrieves a non-const Offset to a complex member - * - * FlatMutableBar is another arbitrary user-defined mutable FlatData type. - */ - FlatMutableBar::Offset my_mutable(); - - /** - * @brief Retrieves a non-const Offset to a complex array - */ - rti::flat::MutableArrayOffset my_mutable_array(); - - /** - * @brief Retrieves a non-const Offset to a complex sequence - */ - rti::flat::SequenceOffset my_mutable_seq(); - - /** - * @brief Retrieves a non-const Offset to a string - */ - rti::flat::StringOffset my_string(); - - /** - * @brief Retrieves a non-const Offset to a sequence of strings - */ - rti::flat::SequenceOffset my_string_seq(); -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Represents the Offset to an arbitrary user-defined FlatData - * mutable IDL union - * - * This example type represents the Offset type that \nddsgen would generate - * for \ref MyFlatUnion. - * - * It provides accessors for each of its members, plus the discriminator _d(). - * Accessors can return other Offsets or primitive values. - * - * Given a union, only one member, the one identified by _d(), can exist at a - * time. The discriminator cannot be modified. - * - */ -class NDDSUSERDllExport MyFlatUnionOffset -: public rti::flat::MutableOffset { - public: - /** - * @brief The equivalent read-only Offset type - */ - typedef MyFlatUnionConstOffset ConstOffset; - - /** - * @brief Creates a null Offset - * - * @post is_null() - */ - MyFlatUnionOffset() - { - } - - /** - * @brief Retrieves the union discriminator - * - * @return The union discriminator, which identifies which field this union - * contains. - * - * In this example: - * - 0 selects my_primitive() - * - 1 and 2 select my_mutable() - * - 3 selects my_final - * - * Any other discriminator value indicates that no member or an unknown - * member follows. - * - * Note that the discriminator cannot be modified, since that would - * potentially change the size of this Sample by selecting a different - * member. The discriminator is selected during the building of a Sample - * (see MyUnionBuilder). - */ - int32_t _d() const; - - /** - * @brief Retrieves the value for a primitive member - * - * @return The value of my_primitive if this member is selected by _d() - * or its default value otherwise. - */ - int32_t my_primitive() const; - - /** - * @brief Retrieves a const Offset to a complex member - * - * @return The Offset to the 'my_mutable' member if selected by _d(), - * or a \ref OffsetErrorManagement "null Offset" otherwise - */ - MyFlatMutable::ConstOffset my_mutable() const; - - /** - * @brief Retrieves a const Offset to a complex member - * - * @return The Offset to the 'my_final' member if selected by _d(), - * or a \ref OffsetErrorManagement "null Offset" otherwise - */ - MyFlatFinal::ConstOffset my_final() const; - - /** - * @brief Sets the value for a primitive member - * - * @pre _d() must select 'my_primitive', otherwise this function - * returns false. - * - * @return true if my_primitive was set or false if the operation failed. - */ - bool my_primitive(int32_t value); - - /** - * @brief Retrieves a non-const Offset to a complex member - * - * @return The Offset to the 'my_mutable' member if selected by _d(), - * or a \ref OffsetErrorManagement "null Offset" otherwise - */ - MyFlatMutable::Offset my_mutable(); - - /** - * @brief Retrieves a non-const Offset to a complex member - * - * @return The Offset to the 'my_final' member if selected by _d(), - * or a \ref OffsetErrorManagement "null Offset" otherwise - */ - MyFlatFinal::Offset my_final(); -}; - -#endif - -namespace rti { namespace flat { - -namespace detail { - -inline rti::flat::offset_t ptrdiff(unsigned char *a, unsigned char *b) -{ - RTI_FLAT_ASSERT(a - b < RTI_XCDR_MAX_SERIALIZED_SIZE, return 0); - - return static_cast(a - b); -} - -// Used to determine which fixed-size types need a DHeader when adding a -// fixed-size member or element. OffsetType classes may specialize this template -// to indicate if they need a DHeader. -template -struct is_fixed_type_w_dheader { - static bool value() - { - return false; - } -}; - -inline bool is_dheader_required_in_non_primitive_collections() -{ - // Allow setting the behavior at compilation time to gain compiler - // optimizations -#if defined(RTI_FLATDATA_NO_DHEADER_COLLECTIONS) - return false; -#elif defined(RTI_FLATDATA_DHEADER_COLLECTIONS) - return true; -#else - // Without any compilation flag, the behavior is configurable at runtime - RTIXCdrXTypesComplianceMask xTypesComplianceMask; - xTypesComplianceMask = RTIXCdrInterpreter_getGlobalXtypeComplianceMask(); - return RTIXCdrXTypesComplianceMask_isBitSet( - xTypesComplianceMask, - RTI_XCDR_XTYPES_DHEADER_IN_NON_PRIMITIVE_COLLECTIONS_BIT); -#endif -} - -inline bool is_dheader_required_in_enum_collections() -{ -#if defined(RTI_FLATDATA_NO_DHEADER_COLLECTIONS) - return false; -#elif defined(RTI_FLATDATA_DHEADER_COLLECTIONS) - return true; -#else - RTIXCdrXTypesComplianceMask xTypesComplianceMask; - xTypesComplianceMask = RTIXCdrInterpreter_getGlobalXtypeComplianceMask(); - return RTIXCdrXTypesComplianceMask_isBitSet( - xTypesComplianceMask, - RTI_XCDR_XTYPES_DHEADER_IN_NON_PRIMITIVE_COLLECTIONS_BIT) - && !RTIXCdrXTypesComplianceMask_isBitSet( - xTypesComplianceMask, - RTI_XCDR_XTYPES_ENUM_AS_PRIMITIVE_IN_COLLECTIONS_BIT); -#endif -} - -template -struct collection_dheader_traits { - static bool dheader_required() - { - return is_dheader_required_in_non_primitive_collections(); - } - - static unsigned int dheader_size() - { - return dheader_required() ? RTI_XCDR_DHEADER_SIZE : 0; - } -}; - -template <> -struct collection_dheader_traits { - static bool dheader_required() - { - return is_dheader_required_in_enum_collections(); - } - - static unsigned int dheader_size() - { - return dheader_required() ? RTI_XCDR_DHEADER_SIZE : 0; - } -}; - -} // namespace detail - -// Forward declaration -template -class FinalArrayOffset; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Base class of all Offset types - * - * @see \ref RTIFlatOffsetsModule - */ -class OffsetBase { -public: - - /** - * @brief Indicates whether this Offset doesn't point to a valid element - * - * \if CPP2_LANGUAGE_ONLY - * Comparing this object with \p nullptr is equivalent to calling is_null(). - * For example: - * \code - * MyFlatMutableOffset my_mutable = ...; - * auto my_final_member = my_mutable.my_final(); - * if (my_final_member.is_null()) { ...member doesn't exist... } - * // alternative syntax: - * if (my_final_member == nullptr) {...} - * \endcode - * \endif - * - * @see \ref OffsetErrorManagement - */ - bool is_null() const - { - return sample_ == NULL; - } - - /** - * @brief Indicates whether rti::flat::plain_cast() is possible - * - * @return True only if the data pointed to by this Offset can be - * rti::flat::plain_cast() - * - * @see rti::flat::plain_cast() for the requirements that a type needs to meet - */ - bool is_cpp_compatible() const - { - // Derived classes may indicate whether - // a type is cpp-compatible - return false; - } - - /** - * @private - * - * For internal use only. See the const overload. - */ - unsigned char * get_buffer() - { - if (is_null()) { - return NULL; - } - return stream_.current_position(); - } - - /** - * @brief Gets this member's position in the buffer - * - * @note This function should be used for debugging purposes only. - * To access the data in this Offset use the Offset accessor methods or, if - * this type allows it, rti::flat::plain_cast(). - * - * Returns the position within the Sample's buffer that this - * Offset points to. - * - * @see get_buffer_size() - */ - const unsigned char * get_buffer() const - { - if (is_null()) { - return NULL; - } - return stream_.current_position(); - } - - /** - * @brief Gets the size, in bytes, of this member in the buffer - * - * Returns the number of bytes that this member comprises - * after the position returned by get_buffer(). - */ - offset_t get_buffer_size() const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return 0); - return stream_.total_size(); - } - - /** - * @brief Compares two Offsets - * - * @return True if s1 points to a position smaller than s2's. - */ - friend bool operator<( - const OffsetBase & s1, - const OffsetBase & s2) { - return s1.get_buffer() < s2.get_buffer(); - } - - /** - * @brief Compares two Offsets - * - * @return True if s1 points to a position greater than s2's. - */ - friend bool operator > ( - const OffsetBase & s1, - const OffsetBase & s2) { - return s1.get_buffer() > s2.get_buffer(); - } - - /** - * @brief Compares two Offsets - * - * @return True if s1 points to a position equal to or smaller than s2's. - */ - friend bool operator <= ( - const OffsetBase & s1, - const OffsetBase & s2) { - return s1.get_buffer() <= s2.get_buffer(); - } - - /** - * @brief Compares two Offsets - * - * @return True if s1 points to a position equal to or greater than s2's. - */ - friend bool operator >= ( - const OffsetBase & s1, - const OffsetBase & s2) { - return s1.get_buffer() >= s2.get_buffer(); - } - - /** - * @brief Determines if two offets point to the same position - * - * @return True if s1 points to the same position as s2. - */ - friend bool operator == ( - const OffsetBase & s1, - const OffsetBase & s2) { - return s1.get_buffer() == s2.get_buffer(); - } - - /** - * @brief Determines if two offets point to different positions - * - * @return True if s1 points to a different position than s2. - */ - friend bool operator != ( - const OffsetBase & s1, - const OffsetBase & s2) { - return !(s1 == s2); - } - -protected: - - OffsetBase() : - sample_(NULL), - absolute_offset_(0) - { - } - - OffsetBase( - SampleBase *sample, - offset_t absolute_offset, - offset_t serialized_size) - : sample_(sample), - absolute_offset_(absolute_offset) - { - // In modern C++ this throws PreconditionNotMetError; in traditional - // C++, this ends the constructor leaving the object in a state such - // that is_null() is true. - RTI_FLAT_CHECK_PRECONDITION(sample != NULL, return); - - sample_->initialize_stream( - stream_.c_stream(), - absolute_offset_, - serialized_size); - } - - // Gets the value of a primitive member at the specified relative Offset - template - U deserialize(offset_t member_offset) const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return U()); - RTI_FLAT_ASSERT(stream_.check_size(member_offset + static_cast(sizeof(U))), return U()); - - rti::xcdr::Stream::Memento stream_memento(stream_); - stream_.skip_fast(member_offset); - return stream_.deserialize_fast(); - } - - // Sets the value of a primitive member at the specified relative Offset - template - bool serialize(offset_t member_offset, U value) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return false); - RTI_FLAT_ASSERT(stream_.check_size(member_offset + static_cast(sizeof(U))), return false); - - rti::xcdr::Stream::Memento stream_memento(stream_); - - stream_.skip_fast(member_offset); - stream_.serialize_fast(value); - return true; - } - - // Obtains a member at the specified relative offset - // - // U is the type of the member. U must be a subclass of Offset. - template - U get_member(offset_t relative_member_offset) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return U()); - - return U( - sample_, - // the absolute location of the member: - absolute_offset_ + relative_member_offset); - } - - template - U get_member(offset_t relative_member_offset) const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return U()); - - return U( - sample_, - // the absolute location of the member: - absolute_offset_ + relative_member_offset); - } - -protected: - SampleBase *sample_; // the actual CDR buffer is in the sample - - offset_t absolute_offset_; // the position of this Offset in the buffer - mutable rti::xcdr::Stream stream_; // a substream that shares the same buffer -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief The base class of all Offsets to a final struct type - * - * This class contains only implementation details; all the public accessors - * are defined in the generated type (MyFlatFinalOffset). - */ -template -class FinalOffset : public OffsetBase { -public: - typedef fixed_size_type_tag_t offset_kind; - - static offset_t serialized_size_w_padding() - { - RTI_FLAT_ASSERT(T::serialized_size(0) > 0, return 0); - RTI_FLAT_ASSERT(T::required_alignment > 0, return 0); - - const offset_t element_size = T::serialized_size(0); - if (element_size % T::required_alignment != 0) { - return element_size + T::required_alignment - - element_size % T::required_alignment; - } else { - return element_size; - } - } - - bool is_cpp_compatible() const // override - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return false); - return !stream_.needs_byte_swap() - && rti::xcdr::has_cpp_friendly_cdr_layout< - typename rti::flat::flat_type_traits::flat_type>(); - } - -protected: - FinalOffset() - { - } - - // Creates an Offset within the sample's CDR buffer at the specified - // absolute offset - // - // This overload requires T::serialized_size(offset_t) - // - FinalOffset(SampleBase *sample, offset_t absolute_offset) - : OffsetBase( - sample, - absolute_offset, - T::serialized_size(absolute_offset)) - { - } - - // Gets the value of a primitive member at the specified relative offset - // relative_member_offsets - the 4 possible offsets depending on the this - // type's initial alignment - template - U deserialize(const offset_t *relative_member_offsets) const - { - RTI_FLAT_ASSERT(relative_member_offsets != NULL, return U()); - - // In a FinalOffset the stream is guaranteed to have enough space to - // contain all its members. There are two possible cases: - // - // - If the FinalOffset is a member of a mutable type, the member getter - // will ensure that the stream has enough space for the whole final - // type. - // - // - If the final offset is a top-level type, the type plugin ensures - // that the serialized buffer is large enough to contain the type. - - return OffsetBase::deserialize( - // pick the right offset based on the initial alignment - get_value_for_alignment(relative_member_offsets)); - } - - // Sets the value of a primitive member at the specified relative offset - template - bool serialize(const offset_t *relative_member_offsets, U value) - { - RTI_FLAT_ASSERT(relative_member_offsets != NULL, return false); - - return OffsetBase::serialize( - // pick the right offset based on the initial alignment - get_value_for_alignment(relative_member_offsets), value); - } - - - // Obtains a member at the specified relative offset - // - // U is the type of the member. U must be a subclass of Offset. - template - U get_member(const offset_t *relative_member_offsets) - { - RTI_FLAT_ASSERT(relative_member_offsets != NULL, return U()); - - return OffsetBase::get_member( - get_value_for_alignment(relative_member_offsets)); - } - - template - U get_member(const offset_t *relative_member_offsets) const - { - RTI_FLAT_ASSERT(relative_member_offsets != NULL, return U()); - - return OffsetBase::get_member( - get_value_for_alignment(relative_member_offsets)); - } - - // Returns an FinalArrayOffset located within this Offset - template - FinalArrayOffset get_array_member( - const offset_t *relative_member_offsets, - const offset_t *first_element_sizes, - offset_t element_size) - { - typedef FinalArrayOffset ArrayType; - - RTI_FLAT_ASSERT(relative_member_offsets != NULL, return ArrayType()); - RTI_FLAT_ASSERT(first_element_sizes != NULL, return ArrayType()); - - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return ArrayType()); - - return ArrayType( - sample_, - // the absolute location of the member: - absolute_offset_ + get_value_for_alignment(relative_member_offsets), - // the size of the first element, which can differ from the rest - get_value_for_alignment(first_element_sizes), - // the size of every other element - element_size); - } - - template - FinalArrayOffset get_array_member( - const offset_t *relative_member_offsets, - const offset_t *first_element_sizes, - offset_t element_size) const - { - typedef FinalArrayOffset ArrayType; - - RTI_FLAT_ASSERT(relative_member_offsets != NULL, return ArrayType()); - RTI_FLAT_ASSERT(first_element_sizes != NULL, return ArrayType()); - - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return ArrayType()); - return ArrayType( - sample_, - // the absolute location of the member: - absolute_offset_ + get_value_for_alignment(relative_member_offsets), - // the size of the first element, which can differ from the rest - get_value_for_alignment(first_element_sizes), - // the size of every other element - element_size); - } - -private: - // A member's relative offset or an array's first element size - // may be different depending on the alignment of the position in the CDR - // buffer of the type that contains them (this). These values are passed - // to get_member or get_array_member as an array of 4 possible values. This - // function picks the right one based on the alingmenet of absolute_offset_ - offset_t get_value_for_alignment(const offset_t *values_per_alignment) const - { - return values_per_alignment - [absolute_offset_ % RTI_XCDR_MAX_XCDR2_ALIGNMENT]; - } -}; - -struct MutableOffsetHelper { - // Obtains the size of a mutable struct located at the absolute_offset of - // a FlatData sample - static offset_t calculate_serialized_size( - rti::flat::SampleBase *sample, - offset_t absolute_offset, - offset_t) - { - RTI_FLAT_ASSERT(sample != NULL, return 0); - - return RTIXCdrFlatSample_getMutableSampleSize( - sample->get_buffer(), - absolute_offset); - } -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief The base class of all Offsets to a final struct type - * - * This class contains only implementation details; all the public accessors - * are defined in the generated type (MyFlatMutableOffset). - */ -class MutableOffset : public OffsetBase { -public: - typedef variable_size_type_tag_t offset_kind; - typedef MutableOffsetHelper Helper; - -protected: - MutableOffset() - { - } - - MutableOffset( - SampleBase *sample, - offset_t absolute_offset, - offset_t serialized_size) - : OffsetBase( - sample, - absolute_offset, - serialized_size) - { - } - - template - U deserialize(member_id_t member_id, U default_val = U()) const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return U()); - - rti::xcdr::Stream::Memento stream_memento(stream_); - - offset_t member_size = 0; - if (!RTIXCdrStream_findV2MutableSampleMember( - &stream_.c_stream(), - member_id, - &member_size)) { - return default_val; - } - - return stream_.deserialize_fast(); - } - - // Sets the value of a primitive member at the specified relative offset - template - bool serialize(member_id_t member_id, U value) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return false); - - rti::xcdr::Stream::Memento stream_memento(stream_); - - offset_t member_size = 0; - if (!RTIXCdrStream_findV2MutableSampleMember( - &stream_.c_stream(), - member_id, - &member_size)) { - return false; - } - - stream_.serialize_fast(value); - return true; - } - - template - U get_member(member_id_t member_id) const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return U()); - - rti::xcdr::Stream::Memento stream_memento(stream_); - - offset_t member_size = 0; - if (!RTIXCdrStream_findV2MutableSampleMember( - &stream_.c_stream(), - member_id, - &member_size)) { - return U(); - } - - return get_member_impl( - // absolute offset to the found member - detail::ptrdiff(stream_.current_position(), sample_->get_buffer()), - member_size, - typename U::offset_kind()); - } - -private: - template - U get_member_impl( - offset_t absolute_member_offset, - offset_t member_size, - variable_size_type_tag_t) const - { - RTI_FLAT_ASSERT(absolute_member_offset > 0, return U()); - - // VariableOffsets receive a member_size - return U(sample_, absolute_member_offset, member_size); - } - - template - U get_member_impl( - offset_t absolute_member_offset, - offset_t member_size, - fixed_size_type_tag_t) const - { - (void) member_size; // suppress unused-param warning in release mode - RTI_FLAT_ASSERT(absolute_member_offset > 0, return U()); - - // FixedOffsets do not receive a member_size (it's already known) - return U(sample_, absolute_member_offset); - } -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief A const Offset to an optional primitive member - * - * Read-only version of PrimitiveOffset. - * - * If !is_null(), the value can be retrieved with get(). - */ -template -struct PrimitiveConstOffset : public OffsetBase { -public: - typedef fixed_size_type_tag_t offset_kind; - - PrimitiveConstOffset() - { - } - - PrimitiveConstOffset( - SampleBase *sample, - offset_t absolute_offset) - : OffsetBase( - sample, - absolute_offset, - serialized_size(0)) - { - } - - bool is_cpp_compatible() const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return false); - return sizeof(T) == 1 || !stream_.needs_byte_swap(); - } - - /** - * @brief Gets the value of this primitive member - * - * @pre !is_null() - */ - T get() const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return T()); - RTI_FLAT_ASSERT(stream_.check_size(sizeof(T)), return T()); - - return stream_.deserialize_fast(); - } - - static offset_t serialized_size(offset_t) - { - return sizeof(T); - } - - static offset_t serialized_size_w_padding() - { - return serialized_size(0); - } - -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief An Offset to an optional primitive member - * - * @tparam T The primitive type - * - * Non-optional primitive members are accessed directly using its container - * type's methods; however, since an optional member may not exist, this Offset - * is returned instead. The only purpose of the type PrimitiveOffset is to - * provide a way to check for the member's existence. - * - * If !is_null(), the value can be retrieved with get() or set with set(). - * - * @see MyFlatMutableOffset::my_optional_primitive vs. - * MyFlatMutableOffset::my_primitive - */ -template -struct PrimitiveOffset : public PrimitiveConstOffset { -public: - PrimitiveOffset() - { - } - - PrimitiveOffset( - SampleBase *sample, - offset_t absolute_offset) - : PrimitiveConstOffset( - sample, - absolute_offset) - { - } - - /** - * @brief Sets a value for this primitive member - * - * @pre !is_null() - */ - bool set(T value) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return false); - RTI_FLAT_ASSERT(this->stream_.check_size(sizeof(T)), return false); - - this->stream_.template serialize_fast(value); - return true; - } -}; - -} } - -#endif // RTI_DDS_FLAT_FLATOFFSETS_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceBuilders.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceBuilders.hpp deleted file mode 100644 index 826dc383d..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceBuilders.hpp +++ /dev/null @@ -1,952 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018-2024. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_SEQUENCEBUILDERS_HPP_ -#define RTI_DDS_FLAT_SEQUENCEBUILDERS_HPP_ - -#include "rti/flat/Builder.hpp" - -// -// Builders for sequences, strings, and arrays. -// -// Type hierarchy (- indicates an abstract builder; * a concrete, usable builder) -// -// - AbstractListBuilder -// * MutableArrayBuilder -// - AbstractSequenceBuilder -// * MutableSequenceBuilder -// * FinalSequenceBuilder -// * PrimitiveSequenceBuilder -// * StringBuilder -// -// Notes: -// - there's no "FinalArrayBuilder" because that's a fixed-size type and -// doesn't need a builder (it's constructed via an "add" operation, not a "build" -// operation). -// - MutableSequenceBuilder "builds" its elements -// - FinalSequenceBuilder "adds" its elements -// - -namespace rti { namespace flat { - -namespace detail { - -template -struct DHeaderGeneratorImpl { - static bool reserve_dheader(rti::xcdr::Stream& stream) - { - if (collection_dheader_traits::dheader_required()) { - return stream.serialize_dheader() != NULL; - } else { - return true; - } - } - - static bool finish_dheader( - rti::xcdr::Stream& stream, - unsigned char *dheader_position) - { - if (collection_dheader_traits::dheader_required()) { - return stream.finish_dheader((char *) dheader_position); - } else { - return true; - } - } - - static bool move_after_dheader( - rti::xcdr::Stream& stream, - unsigned char *begin_position) - { - stream.current_position(begin_position); - - if (collection_dheader_traits::dheader_required()) { - return stream.skip(RTI_XCDR_DHEADER_SIZE); - } else { - return true; - } - } -}; - -struct NoDHeaderGenerator { - static bool reserve_dheader(rti::xcdr::Stream&) - { - return true; - } - - static bool finish_dheader(rti::xcdr::Stream&, unsigned char *) - { - return true; - } - - static bool move_after_dheader( - rti::xcdr::Stream& stream, - unsigned char *begin_position) - { - stream.current_position(begin_position); - return true; - } -}; - -typedef DHeaderGeneratorImpl DHeaderGenerator; -typedef DHeaderGeneratorImpl DHeaderGeneratorForEnum; - -// Maybe specialized for enums to select DHeaderGenerator -template -struct primitive_sequence_dheader_gen { - typedef NoDHeaderGenerator type; -}; - -} // namespace detail - -/*i - * Extends and specializes AbstractBuilder to add or override the - * functionality required to build a collection of consecutive elements - * (sequence or array): - * - * - Add or build elements - * - Keep track of the element count - * - Handle element alignment - * - */ -/** - * @ingroup RTIFlatBuildersModule - * @brief Base class of all array and sequence builders - */ -template -class AbstractListBuilder : public AbstractBuilder { -protected: - AbstractListBuilder() : element_count_(0) - { } - - AbstractListBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment) - : AbstractBuilder(nested_tag_t(), parent, alignment), - element_count_(0) - { - DHeaderGen::reserve_dheader(stream()); - } - - template - ElementBuilder build_next() - { - rti::xcdr::Stream::Memento stream_memento(stream()); - return build_element(stream_memento); - } - - template - ElementOffset add_next() - { - RTI_FLAT_BUILDER_CHECK_VALID(return ElementOffset()); - - // save state in case of error - rti::xcdr::Stream::Memento stream_memento(stream()); - - if (!stream().align(ElementOffset::required_alignment)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return ElementOffset()); - } - - ElementOffset element = add_element(); - if (element.is_null()) { - return ElementOffset(); - } - - // Success: clear memento, increment element count - stream_memento.discard(); - element_count_++; - - return element; - } - - template - void add_n(unsigned int count) - { - RTI_FLAT_BUILDER_CHECK_VALID(return); - - if (count == 0) { - return; - } - - if (!stream().align(ElementOffset::required_alignment)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return); - } - - offset_t elements_size = ElementOffset::serialized_size(0) - + ElementOffset::serialized_size_w_padding() * (count - 1); - if (!stream().skip(elements_size)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return); - } - - element_count_ += count; - } - - /** - * @brief Returns the current number of elements that have been added - */ - unsigned int element_count() const - { - return element_count_; - } - -#if defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) - AbstractListBuilder(AbstractListBuilder&& other) = default; - AbstractListBuilder& operator=(AbstractListBuilder&& other) - { - if (this == &other) { - return *this; - } - - finish_untyped_impl(); - - AbstractBuilder::operator=(static_cast(other)); - - element_count_ = other.element_count_; - other.element_count_ = 0; - - return *this; - } - #else -public: - // Enables the safe-move-constructor idiom without C++11 move constructors - struct AbstractListBuilderMoveProxy : AbstractBuilderMoveProxy { - unsigned int element_count_; - }; - - operator AbstractListBuilderMoveProxy () throw() // move-constructor idiom - { - AbstractListBuilderMoveProxy other; - move_to(other); - return other; - } - -protected: - void move_from(AbstractListBuilderMoveProxy& other) - { - AbstractBuilder::move_from(other); - element_count_ = other.element_count_; - } - - void move_to(AbstractListBuilderMoveProxy& other) - { - AbstractBuilder::move_to(other); - other.element_count_ = element_count_; - } - -#endif - -private: - friend class AbstractBuilder; - - virtual void finish_member() // override - { - RTI_FLAT_BUILDER_CHECK_VALID(return); - - // Increment element count after the nested element builder finishes, - // instead of on build_next(). This makes it easier to roll back the - // state if the element building doesn't complete. - element_count_++; - AbstractBuilder::finish_member(); - } - -protected: - bool finish_dheader() - { - return DHeaderGen::finish_dheader(stream(), begin_position()); - } - - unsigned int element_count_; -}; - -// --- Array: ----------------------------------------------------------------- -// -// (Note: there is no FinalArrayBuilder, because a final array's size is fixed, -// and is handled directly returning its offset with add_*; on the other hand, -// sequences are never fixed-size.) - -/** - * @ingroup RTIFlatBuildersModule - * @brief Builds an array member of variable-size elements - * - * @tparam ElementBuilder The Builder type for the elements of the array - * @tparam N The array bound; the exact number of elements this array builder - * must build. For multidimensional arrays, \p N is the product - * of each dimension bound. - * - * Each element of this array needs to be built using the ElementBuilder returned - * by build_next(). N elements exactly must be built. Unlike a sequence Builder, - * it is not possible to finish an array with less than N elements. - * - * This example shows how to use a MutableArrayBuilder to build an array member - * of MyFlatMutableBuilder: - * - * \code - * MyFlatMutableBuilder builder = rti::flat::build_data(writer); - * auto array_builder = builder.build_my_mutable_array(); - * for (int i = 0; i < 10; i++) { - * FlatMutableBarBuilder element_builder = array_builder.build_next(); - * // ... build element - * element_builder.finish(); - * } - * array_builder.finish(); - * \endcode - * - * Note that Builder types are not necessary for arrays of fixed-size elements, - * since they are added at once (see MyFlatMutableBuilder::add_my_final_array()). - */ -template -class MutableArrayBuilder : public AbstractListBuilder { -public: - /** - * @brief The related Offset type - */ - typedef MutableArrayOffset Offset; - typedef AbstractListBuilder Base; - - MutableArrayBuilder() - { } - - // The destructor does the same as finish_impl() but doesn't need to return - // an Offset - ~MutableArrayBuilder() - { - finish_untyped_impl(); - } - -#if defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) - MutableArrayBuilder(MutableArrayBuilder&& other) = default; - - MutableArrayBuilder& operator=(MutableArrayBuilder&& other) - { - finish_untyped_impl(); - Base::operator=(static_cast(other)); - - return *this; - } -#endif - - void finish_untyped_impl() - { - if (!Base::is_valid() || !Base::is_nested()) { - return; - } - - Base::finish_dheader(); - Base::finish_untyped_impl(); - } - -private: - friend class AbstractBuilder; // to allow access to the constructor - - MutableArrayBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment = 0) - : AbstractListBuilder(nested_tag_t(), parent, alignment) - { - } - -public: - /** - * @brief Begins building the next element - * - * Before calling build_next() to create a new element, the element Builder - * returned by a previous call to build_next must have been finished. - */ - ElementBuilder build_next() - { - if (element_count() == N) { - RTI_FLAT_BUILDER_PRECONDITION_ERROR( - "Array builder build_next: too many elements", - return ElementBuilder()); - } - - return AbstractListBuilder::build_next(); - } - - /** - * @brief Finishes building the array - * - * @pre build_next() must have been succesfully called \p N times exactly. - * @return The Offset to the member that has been built. - * @see discard() - */ - Offset finish() - { - RTI_FLAT_BUILDER_CHECK_CAN_FINISH(return Offset()); - - if (element_count() != N) { - RTI_FLAT_BUILDER_PRECONDITION_ERROR( - "Cannot finish array builder: too few elements", - return Offset()); - } - - if (!finish_dheader()) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return Offset()); - } - - return finish_impl(); - } - - RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL(\ - MutableArrayBuilder, AbstractListBuilder, AbstractListBuilderMoveProxy) - -}; - -// --- Sequences: ------------------------------------------------------------- - -// Specializes AbstractListBuilder to handle the length header serialization -// common to all sequences (which arrays don't have) -/** - * @ingroup RTIFlatBuildersModule - * @brief Base class of Builders for sequence members. - * - * This class contains only implementation details and doesn't add any public - * function to AbstractListBuilder. - */ -template -class AbstractSequenceBuilder : public AbstractListBuilder { -public: - typedef AbstractListBuilder Base; - using Base::element_count; - using Base::is_nested; - using Base::is_valid; - using Base::stream; - using typename Base::nested_tag_t; - #if !defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) - using typename Base::AbstractListBuilderMoveProxy; - #endif - -protected: - - AbstractSequenceBuilder() - { - } - - AbstractSequenceBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment) - : Base(nested_tag_t(), parent, alignment) - { - // leave space for sequence length - if (!stream().check_size(sizeof(rti::xcdr::length_t))) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(this->invalidate()); - } else { - // No need to align; the base constructor already aligned to 4 the - // begin_position - stream().template serialize_fast(0); - } - } - - // The destructor does the same as finish_impl() but doesn't need to return - // an Offset - ~AbstractSequenceBuilder() - { - finish_untyped_impl(); - } - -#if defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) - AbstractSequenceBuilder(AbstractSequenceBuilder&& other) = default; - AbstractSequenceBuilder& operator=(AbstractSequenceBuilder&& other) - { - finish_untyped_impl(); - Base::operator=(static_cast(other)); - - return *this; - } -#endif - - void finish_untyped_impl() - { - if (!Base::is_valid() || !Base::is_nested()) { - return; - } - - Base::finish_dheader(); - finish_length(); - Base::finish_untyped_impl(); - } - - // Concrete sequences must call this method in their own finish() function - template - Offset finish_impl() - { - RTI_FLAT_BUILDER_CHECK_VALID(return Offset()); - RTI_FLAT_BUILDER_CHECK_CAN_FINISH(return Offset()); - - Base::finish_dheader(); - finish_length(); // serialize the length header - return Base::template finish_impl(); - } - -private: - // Serializes the sequence length when finishing the builder. - void finish_length() - { - rti::xcdr::Stream::Memento stream_memento(stream()); - DHeaderGen::move_after_dheader(stream(), Base::begin_position()); - - // Coverity found examples where element_count() is checked, but - // that's only done in Array builders, which are unrelated to this - // class, AbstractSequenceBuilder. - // coverity[CHECKED_RETURN : FALSE] - stream().template serialize_fast(element_count()); - } -}; - -/** - * @ingroup RTIFlatBuildersModule - * @brief Builds a sequence member of variable-size elements - * - * @tparam ElementBuilder The Builder type for the elements of the sequence - * - * To build the elements use the ElementBuilder returned - * by build_next(). An empty sequence can be built by calling finish() without - * any call to build_next(). - * - * This class doesn't enforce the sequence bound set in IDL. - * - * The following example uses a MutableSequenceBuilder to initialize a sequence - * member of MyFlatMutableBuilder with two elements: - * - * \code - * MyFlatMutableBuilder builder = rti::flat::build_data(writer); - * auto seq_builder = builder.build_my_mutable_seq(); - * auto element_builder = seq_builder.build_next(); - * // ... build the first element - * element_builder.finish(); - * element_builder = seq_builder.build_next(); - * // ... build the second element - * element_builder.finish(); - * - * seq_builder.finish(); - * \endcode - */ -template -class MutableSequenceBuilder - : public AbstractSequenceBuilder { -public: - /** - * @brief The related Offset type - */ - typedef SequenceOffset Offset; - - MutableSequenceBuilder() - { - } - -private: - typedef AbstractSequenceBuilder Base; - - friend class AbstractBuilder; // to allow access to the constructor - - MutableSequenceBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment = RTI_XCDR_DHEADER_ALIGNMENT) - : Base(nested_tag_t(), parent, alignment) - { - } - -public: - /** - * @brief Begins building the next element - * - * Before calling build_next() to create a new element, the application must - * have called finish() on the previous element Builder. - */ - ElementBuilder build_next() - { - return AbstractListBuilder::build_next(); - } - - /** - * @brief Finishes building the sequence - * - * @return An Offset to the member that has been built. - * - * @see discard() - */ - Offset finish() - { - return finish_impl(); - } - - RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL( - MutableSequenceBuilder, - Base, - AbstractListBuilderMoveProxy) -}; - -/** - * @ingroup RTIFlatBuildersModule - * @brief Builds a sequence member of fixed-size elements - * - * @tparam ElementOffset The Offset type for the elements of the sequence - * - * To add an element, call add_next() and use the ElementOffset it returns to - * initialize the element's values. An empty sequence can be built by - * calling finish() without any call to add_next(). - * - * This class doesn't enforce the sequence bound set in IDL. - * - * The following example uses a FinalSequenceBuilder to initialize a sequence - * member of MyFlatMutableBuilder with two elements: - * - * \code - * MyFlatMutableBuilder builder = rti::flat::build_data(writer); - * auto seq_builder = builder.build_my_final_seq(); - * MyFlatFinalOffset element = seq_builder.add_next(); - * element.my_primitive(1); - * // ... continue initializing the first element - * - * element = seq_builder.add_next(); - * element.my_primitive(2); - * // ... continue initializing the second element - * - * seq_builder.finish(); - * \endcode - * - * If the element type meets certain requirements, rti::flat::plain_cast() - * provides a more efficient way to initialize a sequence of final elements. - */ -template -class FinalSequenceBuilder - : public AbstractSequenceBuilder { -public: - typedef SequenceOffset Offset; - - FinalSequenceBuilder() - { - } - -private: - friend class AbstractBuilder; // to allow access to the constructor - - FinalSequenceBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment = RTI_XCDR_SEQ_LENGTH_ALIGNMENT) - : AbstractSequenceBuilder(nested_tag_t(), parent, alignment) - { - } - -public: - /** - * @brief Adds the next element - * - * @return The Offset that can be used to set the element values - */ - ElementOffset add_next() - { - return AbstractListBuilder::add_next(); - } - - /** - * @brief Adds a number of elements at once - * - * This is an alternative to add_next(). - * - * To initialize the elements, call finish() and use the Offset it returns - * to access the elements. - */ - FinalSequenceBuilder& add_n(unsigned int count) - { - AbstractListBuilder::add_n(count); - return *this; - } - - /** - * @brief Finishes building the sequence - * - * @return An Offset to the member that has been built. - * @see discard() - */ - Offset finish() - { - return finish_impl(); - } - - RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL(\ - FinalSequenceBuilder, AbstractSequenceBuilder, AbstractListBuilderMoveProxy) -}; - -/** - * @ingroup RTIFlatBuildersModule - * @brief Builds a sequence of primitive members - * - * The elements can be added one by one with add_next() or all at once with - * add_n(). - */ -template -class PrimitiveSequenceBuilder - : public AbstractSequenceBuilder< - typename detail::primitive_sequence_dheader_gen::type> { -public: - typedef PrimitiveSequenceOffset Offset; - typedef AbstractSequenceBuilder< - typename detail::primitive_sequence_dheader_gen::type> - Base; - using Base::is_valid; - using Base::stream; - using typename Base::nested_tag_t; -#if !defined(RTI_FLAT_DATA_CXX11_RVALUE_REFERENCES) - using typename Base::AbstractListBuilderMoveProxy; -#endif - - PrimitiveSequenceBuilder() - { - } - -protected: - friend class AbstractBuilder; // to allow access to the constructor - - PrimitiveSequenceBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment = RTI_XCDR_SEQ_LENGTH_ALIGNMENT) - : Base(nested_tag_t(), parent, alignment) - { - } - -public: - /** - * @brief Adds the next element - * - * @param value The primitive element to add - */ - PrimitiveSequenceBuilder& add_next(T value) - { - RTI_FLAT_BUILDER_CHECK_VALID(return *this); - - if (!stream().template serialize(value)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return *this); - } - - Base::element_count_++; - return *this; - } - - /** - * @brief Adds all the elements in an array - * - * @param array The array containing the values to add - * @param count The size of the array - * - * @pre array must not be NULL - */ - PrimitiveSequenceBuilder& add_n(const T *array, unsigned int count) - { - RTI_FLAT_BUILDER_CHECK_VALID(return *this); - RTI_FLAT_ASSERT(array != NULL, return *this); - - if (RTIXCdrUnsignedLong_MAX / static_cast(sizeof(T)) - < count) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return *this); - } - - if (!stream().check_size(static_cast(sizeof(T)) * count)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return *this); - } - - if (stream().needs_byte_swap() && sizeof(T) > 1) { - for (unsigned int i = 0; i < count; i++) { - stream().template serialize_fast(array[i]); - } - } else { - stream().serialize_fast((void *) array, count * static_cast(sizeof(T))); - } - - Base::element_count_ += count; - return *this; - } - - /** - * @brief Adds a number of elements with the same value - * - * This overload initializes all the elements to a value. - * - * @note This operation is O(\p count). The other overloads, - * add_n(unsigned int) and add_n(const T*, unsigned int), are more - * efficient - * - * - * @param count The number of elements to add - * @param value The value to set for each element - */ - PrimitiveSequenceBuilder& add_n(unsigned int count, T value) - { - RTI_FLAT_BUILDER_CHECK_VALID(return *this); - - if (RTIXCdrUnsignedLong_MAX / static_cast(sizeof(T)) - < count) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return *this); - } - - if (!stream().check_size(static_cast(sizeof(T)) * count)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return *this); - } - - for (unsigned int i = 0; i < count; i++) { - stream().template serialize_fast(value); - } - Base::element_count_ += count; - return *this; - } - - /** - * @brief Adds a number of uninitialized elements - * - * This operation is O(1), since it leaves the elements uninitialized. - * They can be initialized using the Offset returned by finish() and - * rti::flat::plain_cast(). For example: - * - * \code - * MyFlatMutableBuilder builder = ...; - * auto seq_builder = builder.build_my_primitive_seq(); - * seq_builder.add_n(1000); - * auto seq_offset = seq_builder.finish(); - * int32_t *elements = rti::flat::plain_cast(seq_offset); - * for (int i = 0; i < 1000; i++) { - * elements[i] = ...; - * } - * \endcode - * - * @param count The number of elements to add - */ - PrimitiveSequenceBuilder& add_n(unsigned int count) - { - RTI_FLAT_BUILDER_CHECK_VALID(return *this); - - if (RTIXCdrUnsignedLong_MAX / static_cast(sizeof(T)) - < count) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return *this); - } - - if (!stream().skip(static_cast(sizeof(T)) * count)) { - RTI_FLAT_BUILDER_OUT_OF_RESOURCES_ERROR(return *this); - } - - Base::element_count_ += count; - return *this; - } - - - /** - * @brief Finishes building the sequence - * - * @return An Offset to the member that has been built. - * @see discard() - */ - Offset finish() - { - this->finish_dheader(); - return Base::template finish_impl(); - } - -private: - RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL(\ - PrimitiveSequenceBuilder, Base, AbstractListBuilderMoveProxy) -}; - -/** - * @ingroup RTIFlatBuildersModule - * @brief Builds a string - * - * A StringBuilder only provides one method, set_string(), so it can be - * typically used as follows: - * - * \code - * MyFlatMutableBuilder my_builder = ...; - * my_builder.build_my_string().set_string("Hello!"); - * \endcode - * - * Note that by relying on the builder destructor, there is no need to call - * finish() on the object returned by build_my_string(). - */ -class StringBuilder : public PrimitiveSequenceBuilder { -public: - typedef StringOffset Offset; - typedef PrimitiveSequenceBuilder Base; - using Base::is_valid; - using Base::stream; - using typename Base::nested_tag_t; - - StringBuilder() - { - } - -private: - friend class AbstractBuilder; // to allow access to the constructor - - StringBuilder( - nested_tag_t, - AbstractBuilder& parent, - unsigned int alignment = RTI_XCDR_SEQ_LENGTH_ALIGNMENT) - : Base(nested_tag_t(), parent, alignment) - { - } - -public: - /** - * @brief Sets the string value - * - * @param value The string value to set. - * - * @pre value must not be NULL. - */ - StringBuilder& set_string(const char *value) - { - RTI_FLAT_BUILDER_CHECK_VALID(return *this); - RTI_FLAT_ASSERT(value != NULL, return *this); - - // if set_string is called more than once we override the string - // that was set before - if (Base::element_count_ != 0) { - stream().current_position(begin_position()); - stream().serialize_fast(0); - Base::element_count_ = 0; - } - - unsigned int length = - static_cast(RTIXCdrString_getLength(value)) + 1; - add_n(value, length); // if this fail, error has been reported - return *this; - } - - /** - * @brief Finishes building the string - * - * @return An Offset to the member that has been built. - * @see discard() - */ - Offset finish() - { - RTI_FLAT_BUILDER_CHECK_VALID(return Offset()); - - if (element_count_ == 0) { - add_next('\0'); // build empty string if no string was built - } - - Base::finish_dheader(); - return finish_impl(); - } - - RTI_FLAT_BUILDER_DEFINE_MOVE_OPERATIONS_IMPL(\ - StringBuilder, Base, AbstractListBuilderMoveProxy) -}; - -// Wide strings are treated as a sequence of octets -typedef PrimitiveSequenceBuilder WStringBuilder; - -} } - -#endif // RTI_DDS_FLAT_SEQUENCEBUILDERS_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceIterator.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceIterator.hpp deleted file mode 100644 index 3426687aa..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceIterator.hpp +++ /dev/null @@ -1,345 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_SEQUENCEITERATOR_HPP_ -#define RTI_DDS_FLAT_SEQUENCEITERATOR_HPP_ - -#include - -#include "rti/flat/Offset.hpp" - -namespace rti { namespace flat { - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Iterator for collections of Offsets - * - * @tparam E The Offset type of the elements - * @tparam OffsetKind (implementation detail) - * - * @note This type should not be declared directly. For example, for a - * SequenceOffset, use SequenceOffset::iterator (or simply \p auto). - * - * A SequenceIterator moves through the Offset to elements of a sequence or - * array \ref RTIFlatOffsetsModule "Offset", and provides the functionality of - * a standard \p forward_iterator. - * - * Note that a dereferenced SequenceIterator returns by value the Offset - * to the current element; it doesn't return it by reference. - * - * \if CPP_LANGUAGE_ONLY - * Since the Traditional C++ API doesn't use exceptions, it is recommended - * to use the function advance() instead of operator++ to check for errors - * \endif - * - */ -template -class SequenceIterator { -public: - /** - * @brief The iterator category - */ - typedef std::forward_iterator_tag iterator_category; - - /** - * @brief The element type - */ - typedef E value_type; - - /** - * @brief The reference type is the same as the value type, an Offset - */ - typedef value_type reference; - - /** - * @brief The pointer type is the same as the value type, an Offset - */ - typedef value_type pointer; - - /** - * @brief The difference type - */ - typedef std::ptrdiff_t difference_type; - - /** - * @brief Constructs an invalid iterator - */ - SequenceIterator() : sample_(NULL), current_offset_(0), max_offset_(0) - { - } - - SequenceIterator( - rti::flat::SampleBase *sample, - offset_t initial_offset, - offset_t max_offset) - : sample_(sample), - current_offset_(initial_offset), - max_offset_(max_offset) - { - RTI_FLAT_ASSERT(sample != NULL, return); - } - - /** - * @brief Returns whether the iterator is invalid - */ - bool is_null() const - { - return sample_ == NULL; - } - - /** - * @brief Returns the Offset of the current element - * - * @return The Offset to the current element. Note that this function returns - * by value, not by reference. This Offset may be - * \ref rti::flat::OffsetBase::is_null "null" if the iterator has surpassed - * the length of the collection. See \ref OffsetErrorManagement. - */ - value_type operator*() const - { - return get_impl(OffsetKind()); - } - - /** - * @brief Returns the Offset of the current element - */ - value_type operator->() const - { - return get_impl(OffsetKind()); - } - - /** - * @brief Advances to the next element, reporting any errors by returning false - * - * \if CPP_LANGUAGE_ONLY - * Since the Traditional C++ API doesn't support exceptions, this function - * is recommended instead of operator++. - * \endif - * \if CPP2_LANGUAGE_ONLY - * Unlike operator++, which throws an exception in case of error, advance() - * returns false - * \endif - * - * @return True if the function succeeds, or false if there was an error - */ - bool advance() - { - // Unlike operator++, advance() allows checking for errors when - // exceptions are disabled (traditional C++) - return advance_impl(OffsetKind()); - } - - /** - * @brief Advances to the next element - * - * \if CPP_LANGUAGE_ONLY - * @warning Since the Traditional C++ API doesn't use exceptions, use - * advance() instead of this operator to check for errors. - * \endif - */ - SequenceIterator& operator++() - { - bool can_advance_iter = advance_impl(OffsetKind()); - RTI_FLAT_CHECK_PRECONDITION(can_advance_iter, return *this); - return *this; - } - - /** - * @brief Advances to the next element - * - * \if CPP_LANGUAGE_ONLY - * @warning Since the Traditional C++ API doesn't use exceptions, use - * advance() instead of this operator to check for errors. - * \endif - */ - SequenceIterator operator++(int) - { - SequenceIterator tmp(*this); - ++(*this); - return tmp; - } - - /** - * @brief Compares two iterators - */ - friend bool operator<( - const SequenceIterator & s1, - const SequenceIterator & s2) - { - return s1.get_position() < s2.get_position(); - } - - /** - * @brief Compares two iterators - */ - friend bool operator > ( - const SequenceIterator & s1, - const SequenceIterator & s2) - { - return s1.get_position() > s2.get_position(); - } - - /** - * @brief Compares two iterators - */ - friend bool operator <= ( - const SequenceIterator & s1, - const SequenceIterator & s2) - { - return s1.get_position() <= s2.get_position(); - } - - /** - * @brief Compares two iterators - */ - friend bool operator >= ( - const SequenceIterator & s1, - const SequenceIterator & s2) - { - return s1.get_position() >= s2.get_position(); - } - - /** - * @brief Compares two iterators - */ - friend bool operator == ( - const SequenceIterator & s1, - const SequenceIterator & s2) - { - return s1.get_position() == s2.get_position(); - } - - /** - * @brief Compares two iterators - */ - friend bool operator != ( - const SequenceIterator & s1, - const SequenceIterator & s2) - { - return !(s1 == s2); - } - - unsigned char * get_position() const - { - if (is_null()) { - return NULL; - } else { - return sample_->get_buffer() + current_offset_; - } - } - -private: - E get_impl(variable_size_type_tag_t) const - { - if (is_null()) { - return E(); - } - - // The iterator points to the end of the previous element. If elements - // need padding, we have to add it here (required alignment is 4 because - // mutable types (variable_size_type_tag_t) are always aligned to 4) - offset_t offset = RTIXCdrAlignment_alignSizeUp(current_offset_, 4); - - if (offset >= max_offset_) { - return E(); - } - - // Calculate the size of the current element; if E is a struct type, - // this will be quick (just deserialize the DHeader); if we're itearating - // over an array of sequences (E is a sequence), this will require - // skipping over the current sequence. - offset_t size = E::Helper::calculate_serialized_size( - sample_, - offset, - max_offset_); - // size 0 indicates an error; a variable-size type E cannot have size - // zero because it will always have a header (DHeader for mutable structs, - // length for sequences) - if (size == 0) { - return E(); - } - - return E(sample_, offset, size); - } - - E get_impl(fixed_size_type_tag_t) const - { - if (is_null()) { - return E(); - } - - // The iterator points to the end of the previous element. If elements - // need padding, we have to add it here. - offset_t offset = RTIXCdrAlignment_alignSizeUp( - current_offset_, - E::required_alignment); - if (offset >= max_offset_) { - return E(); - } - - return E(sample_, offset); - } - - bool advance_impl(variable_size_type_tag_t) - { - if (is_null()) { - return false; - } - - current_offset_ = RTIXCdrAlignment_alignSizeUp(current_offset_, 4); - offset_t size = E::Helper::calculate_serialized_size( - sample_, // beginning of the buffer - current_offset_, // absolute offset to the current element - max_offset_); // maximum offset in the list - if (size == 0) { - return false; - } - - current_offset_ += size; - - if (current_offset_ > max_offset_) { - current_offset_ = max_offset_; - return false; - } - - return true; - } - - bool advance_impl(fixed_size_type_tag_t) - { - if (is_null()) { - return false; - } - - // The iterator points to the end of the previous element. If elements - // need padding, we have to add it here. We do that to keep the end() - // iterator consistent, becuase the last element may not need padding. - current_offset_ = RTIXCdrAlignment_alignSizeUp( - current_offset_, - E::required_alignment); - current_offset_ += E::serialized_size(0); - - if (current_offset_ > max_offset_) { - current_offset_ = max_offset_; - return false; - } - - return true; - } - - rti::flat::SampleBase *sample_; - offset_t current_offset_; - offset_t max_offset_; -}; - -} } - -#endif // RTI_DDS_FLAT_SEQUENCEITERATOR_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceOffsets.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceOffsets.hpp deleted file mode 100644 index 0e613fd17..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/SequenceOffsets.hpp +++ /dev/null @@ -1,844 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef RTI_DDS_FLAT_SEQUENCEOFFSETS_HPP_ -#define RTI_DDS_FLAT_SEQUENCEOFFSETS_HPP_ - -#include "rti/flat/Offset.hpp" -#include "rti/flat/SequenceIterator.hpp" - -namespace rti { namespace flat { - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Base class for Offsets to sequences and arrays of primitive types - * - * @tparam T The primitive type - * - */ -template -class AbstractPrimitiveList : public OffsetBase { -public: - typedef T value_type; - -protected: - AbstractPrimitiveList() - { - } - - AbstractPrimitiveList( - rti::flat::SampleBase *sample, - offset_t offset, - offset_t sequence_size) - : OffsetBase(sample, offset, sequence_size) - { - } - -public: - - bool is_cpp_compatible() const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return false); - return sizeof(T) == 1 || !stream_.needs_byte_swap(); - } - - - /*@private - * @brief Gets direct access to the elements - * - * Returns a pointer to the elements of this sequence. - * - * @note If the Sample that contains this PrimitiveSequenceOffset has an endianess - * different from the native one, the element bytes may be swapped. This can - * happen if this Sample was published by a DataWriter running on a platform - * with a different endianess and received by a DataReader running locally. - * - * This function is not for public use. See rti::flat::plain_cast() instead. - */ - T * get_elements() - { - return reinterpret_cast(this->get_buffer()); - } - - /*@private - * @brief Gets direct access to the array elements - * - * (Const overload) - */ - const T * get_elements() const - { - return reinterpret_cast(this->get_buffer()); - } - - /** - * @brief Returns an element by index - * - * @param i The zero-based index of the element - * - * @see rti::flat::plain_cast() for a method to access all the elements at - * once - */ - T get_element(unsigned int i) const - { - // OffsetBase::serialize only checks this as a debug assertion; in - // a sequence or array we need to do it in release mode too - if (!stream_.check_size((i + 1) * ((unsigned int) sizeof(T)))) { - return T(); - } - - return OffsetBase::template deserialize(i * (unsigned int) sizeof(T)); - } - - /** - * @brief Sets an element by index - * - * @param i The zero-based index of the element to set - * @param value The value to set - * - * @return true if it was possible to set the element, or false if this - * collection has less than i - 1 elements. - * - * @see rti::flat::plain_cast() for a method to access all the elements at - * once - */ - bool set_element(unsigned int i, T value) - { - // OffsetBase::serialize only checks this as a debug assertion; in - // a sequence or array we need to do it in release mode too - if (!stream_.check_size((i + 1) * static_cast(sizeof(T)))) { - return false; - } - - return OffsetBase::serialize(i * static_cast(sizeof(T)), value); - } -}; - -namespace detail { - -template -struct PrimitiveSequenceOffsetHelper; - -template -struct primitive_sequence_header_length { - static size_t value() - { - return sizeof(rti::xcdr::length_t); - } -}; - -} // namespace detail - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Offset to a sequence of primitive elements - * - * @tparam T The primitive type - * - */ -template -class PrimitiveSequenceOffset : public AbstractPrimitiveList { -public: - typedef variable_size_type_tag_t offset_kind; - typedef detail::PrimitiveSequenceOffsetHelper Helper; - - PrimitiveSequenceOffset() : element_count_(0) - { - } - - PrimitiveSequenceOffset( - rti::flat::SampleBase *sample, - offset_t offset, - offset_t serialized_size) - : AbstractPrimitiveList( - // passing NULL causes the base constructors to fail - serialized_size >= static_cast(header_length()) ? sample : NULL, - offset + static_cast(header_length()), - serialized_size - static_cast(header_length())), - element_count_(0) - { -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - if (!this->is_null()) { // without exceptions, we need to check if the base ctor failed -#endif - rti::xcdr::Stream::Memento stream_memento(this->stream_); - this->stream_.skip_back(sizeof(rti::xcdr::length_t)); - element_count_ = this->stream_.template deserialize_fast(); -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - } -#endif - - } - - /** - * @brief Returns the number of elements - */ - unsigned int element_count() const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return 0); - - return element_count_; - } - -private: - static size_t header_length() - { - return detail::primitive_sequence_header_length::value(); - } - - unsigned int element_count_; - -}; - -namespace detail { - -template -struct PrimitiveSequenceOffsetHelper { - static offset_t calculate_serialized_size( - rti::flat::SampleBase *sample, - offset_t absolute_offset, - offset_t max_size) - { - RTI_FLAT_ASSERT(sample != NULL, return 0); - RTI_FLAT_ASSERT(max_size > sizeof(rti::xcdr::length_t), return 0); - - PrimitiveSequenceOffset tmp(sample, absolute_offset, max_size); - - // elements + header - if ((RTIXCdrUnsignedLong_MAX - - static_cast(sizeof(rti::xcdr::length_t))) - / static_cast(sizeof(T)) - < tmp.element_count()) { - RTI_FLAT_OFFSET_PRECONDITION_ERROR( - "Serialized size of a sequence of primitive elements " - "exceeds maximum representable 32-bit unsigned integer.", - return 0); - } - return (tmp.element_count() * static_cast(sizeof(T))) - + static_cast(sizeof(rti::xcdr::length_t)); - } -}; - -} // namespace detail - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Offset to an array of primitive elements - * - * @tparam T The primitive type - * @tparam N The array bound. For multidimensional arrays, \p N is the product - * of each dimension bound. - * - * A PrimitiveArrayOffset may meet the requirements to be cast to an array of - * the equivalent plain C++ element type (see rti::flat::plain_cast()). - */ -template -class PrimitiveArrayOffset : public AbstractPrimitiveList { -public: - typedef fixed_size_type_tag_t offset_kind; - - PrimitiveArrayOffset() - { - } - - PrimitiveArrayOffset(rti::flat::SampleBase *sample, offset_t offset) - : AbstractPrimitiveList( - sample, - offset + static_cast(header_length()), - serialized_size(0)) - { - } - -public: - - /** - * @brief Returns the number of elements, \p N - * - */ - unsigned int element_count() const - { - return N; - } - - static offset_t serialized_size(offset_t) - { - return sizeof(T) * N; - } - -private: - static size_t header_length() - { - return detail::primitive_sequence_header_length::value() - - sizeof(rti::xcdr::length_t); - } -}; - -// Note: the modern C++ API defines a PrimitiveArrayOffset specializations for -// safe_enum and wchar_t - -struct StringOffsetHelper; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Offset to a string - * - */ -class StringOffset : public PrimitiveSequenceOffset { -public: - typedef variable_size_type_tag_t offset_kind; - typedef StringOffsetHelper Helper; - - StringOffset() - { - } - - StringOffset( - SampleBase *sample, - offset_t absolute_offset, - offset_t serialized_size) - : PrimitiveSequenceOffset( - sample, - absolute_offset, - serialized_size) - { - } - - /** - * @brief Gets the string - * - * The string returned can be modified as long as its size doesn't change. - */ - char * get_string() - { - return reinterpret_cast(this->get_buffer()); - } - - /** - * @brief Gets the string (const) - * - */ - const char * get_string() const - { - return reinterpret_cast(this->get_buffer()); - } - - /** - * @brief Returns the number of characters - * - * This number doesn't include the null terminating character. - */ - unsigned int element_count() const - { - RTI_FLAT_CHECK_PRECONDITION( - PrimitiveSequenceOffset::element_count() > 0, - return 0); - - return PrimitiveSequenceOffset::element_count() - 1; - } -}; - -struct StringOffsetHelper { - static offset_t calculate_serialized_size( - rti::flat::SampleBase *sample, - offset_t absolute_offset, - offset_t max_size) - { - StringOffset tmp(sample, absolute_offset, max_size); - return tmp.element_count() - + 1 // null terminator - + (unsigned int) sizeof(rti::xcdr::length_t); // length header - } -}; - -// Wide strings are treated as a sequence of octets -typedef PrimitiveSequenceOffset WStringOffset; - -// The base class of SequenceOffset, and FinalAlignedArrayOffset -// -// This encapsulates the functionality that allows iterating through a list -// of elements (a sequence or an array). The list must be always aligned to 4 -// (that excludes FinalArrayOffset) -// -/** - * @ingroup RTIFlatOffsetsModule - * @brief Base class of Offsets to sequences and arrays of non-primitive members - * - * @tparam ElementOffset The Offset type of the elements - */ -template -class AbstractAlignedList : public OffsetBase { -public: - - /** - * @brief The iterator type, SequenceIterator - */ - typedef SequenceIterator - iterator; - -protected: - AbstractAlignedList() - { - } - - AbstractAlignedList( - rti::flat::SampleBase *sample, - offset_t offset, - offset_t sequence_size) - : OffsetBase( - sample, - offset, - sequence_size) - { - } - -public: - bool is_cpp_compatible() const // override - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return false); - return !stream_.needs_byte_swap() - && rti::xcdr::has_cpp_friendly_cdr_layout_collection< - typename rti::flat::flat_type_traits::flat_type>(); - } - - ElementOffset get_element(unsigned int i) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return ElementOffset()); - - return get_element_impl( - i, - typename ElementOffset::offset_kind()); - } - - /** - * @brief Gets an iterator to the first Offset - * - * begin() and end() enable the use of range-for loops, for example: - * \code - * SequenceOffset sequence_offset = my_type_offset.my_sequence(); - * for (auto element : sequence_offset) { - * std::cout << element.x() << std::endl; - * } - * \endcode - * - */ - iterator begin() - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return iterator(NULL, 0, 0)); - - return iterator( - sample_, - absolute_offset_, - absolute_offset_ + get_buffer_size()); - } - - /** - * @brief Gets an iterator to the past-the-end element - */ - iterator end() - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return iterator(NULL, 0, 0)); - - return iterator( - sample_, - absolute_offset_ + get_buffer_size(), - absolute_offset_ + get_buffer_size()); - } - -private: - // for variable size types we skip element by element - template - E get_element_impl(unsigned int i, variable_size_type_tag_t) - { - iterator it = begin(); - while (it != end() && i > 0) { - if (!it.advance()) { - return E(); - } - i--; - } - - return *it; - } - - // for fixed-size types we support random access - template - E get_element_impl(unsigned int i, fixed_size_type_tag_t) - { - offset_t size = i * E::serialized_size_w_padding(); - - // Ensure that the stream has space for i + 1 elements - if (!stream_.check_size(size + E::serialized_size(0))) { - return E(); - } - - return E(this->sample_, this->absolute_offset_ + size); - } -}; - -template -struct SequenceOffsetHelper; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Offset to a sequence of non-primitive elements - * - * @tparam ElementOffset The Offset type, for example MyFlatMutableOffset, - * MyFlatFinalOffset, or StringOffset. - * - * Represents an Offset to a sequence member and allows getting an Offset to - * each of its elements. - * - * A SequenceOffset may meet the requirements to be cast to an array of - * the equivalent plain C++ element type (see rti::flat::plain_cast), if the - * \p ElementOffset is a final type. - */ -template -class SequenceOffset : public AbstractAlignedList { -public: - typedef variable_size_type_tag_t offset_kind; - typedef SequenceOffsetHelper Helper; - - SequenceOffset() : element_count_(0) - { - } - - SequenceOffset( - rti::flat::SampleBase *sample, - offset_t offset, - offset_t sequence_size) - : AbstractAlignedList( - // Member size in bytes must be > 4, otherwise let base ctor - // fail - sequence_size >= header_length() ? sample : NULL, - // The offset begins after any padding to align to 4; - // padding may be needed for example for an array of - // sequence of final types; the end position of the previous - // sequence may not be aligned - RTIXCdrAlignment_alignSizeUp( - offset, - RTI_XCDR_SEQ_LENGTH_ALIGNMENT) - + header_length(), - sequence_size - header_length()), - element_count_(0) - { -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - if (!this->is_null()) { // without exceptions, we need to check if the base ctor failed -#endif - rti::xcdr::Stream::Memento stream_memento(this->stream_); - this->stream_.skip_back(sizeof(rti::xcdr::length_t)); - element_count_ = this->stream_.template deserialize_fast(); -#ifdef RTI_FLAT_DATA_NO_EXCEPTIONS - } -#endif - } - - /** - * @brief Gets the Offset to an element - * - * @param i The zero-based index to the element - * @return The Offset to the element in the i-th position - */ - ElementOffset get_element(unsigned int i) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return ElementOffset()); - - if (i >= element_count_) { - return ElementOffset(); - } - return AbstractAlignedList::get_element(i); - } - - /** - * @brief The number of elements - */ - unsigned int element_count() const - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return 0); - - return element_count_; - } - -private: - static offset_t header_length() - { - return static_cast( - detail::collection_dheader_traits::dheader_size() - + sizeof(rti::xcdr::length_t)); - } - - - unsigned int element_count_; -}; - -template -struct SequenceOffsetHelper { - // Calculates the serialized size of a Sequence by skipping each element - static offset_t calculate_serialized_size( - rti::flat::SampleBase *sample, - offset_t absolute_offset, - offset_t max_offset) - { - // Create a SequenceOffset beginning at sample + absolute_offset, - // with a size we don't know, but no greater than - // max_offset - absolute_offset - SequenceOffset tmp( - sample, - absolute_offset, - max_offset - absolute_offset); - unsigned int count = tmp.element_count(); - typename SequenceOffset::iterator it = tmp.begin(); - for (unsigned int i = 0; i < count; i++) { - if (!it.advance()) { - return 0; // error - } - } - - return detail::ptrdiff(it.get_position(), sample->get_buffer()) - - absolute_offset; - } -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Offset to an array of variable-size elements - * - * @tparam ElementOffset An Offset for a type of variable size, such as a - * mutable struct (MyFlatMutableOffset), union, or StringOffset. - * @tparam N The array bound. For multidimensional arrays, \p N is the product - * of each dimension bound. - * - * Represents an Offset to an array member and allows getting an Offset to - * each of its elements. - * - * @see FinalArrayOffset encapsulates arrays of fixed-size elements - */ -template -class MutableArrayOffset : public AbstractAlignedList { -public: - typedef variable_size_type_tag_t offset_kind; - - MutableArrayOffset() - { - } - - MutableArrayOffset( - rti::flat::SampleBase *sample, - offset_t offset, - offset_t sequence_size) - : AbstractAlignedList( - sequence_size >= header_length() ? sample : NULL, - offset + header_length(), - sequence_size - header_length()) - { - } - - /** - * @brief Gets the Offset to an element - * - * @param i The zero-based index to the element - * @return The Offset to the element in the i-th position - */ - ElementOffset get_element(unsigned int i) - { - if (i >= N) { - return ElementOffset(); - } - - return AbstractAlignedList::get_element(i); - } - -private: - static offset_t header_length() - { - return static_cast( - detail::collection_dheader_traits::dheader_size()); - } -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Offset to an array of final elements - * - * @tparam ElementOffset A final struct Offset, such as MyFlatFinalOffset. - * @tparam N The array bound. For multidimensional arrays, \p N is the product - * of each dimension bound. - * - * Represents an Offset to an array member and allows getting an Offset to - * each of its elements. - * - * FinalArrayOffset and FinalAlignedArrayOffset provide the same - * interface, but have different implementation details. FinalArrayOffset is - * used when the array member is part of a final type too, whereas - * FinalAlignedArrayOffset corresponds to an array inside a mutable type. - * - * A FinalArrayOffset may meet the requirements to be cast to an array of - * the equivalent plain C++ element type (see rti::flat::plain_cast()). - */ -template -class FinalArrayOffset : public OffsetBase { -public: - typedef fixed_size_type_tag_t offset_kind; - - FinalArrayOffset() - { - } - - // Constructor used when this array is part of a fixed-size type, and - // therefore it's initial alignment is not known ahead of time - FinalArrayOffset( - rti::flat::SampleBase *sample, - offset_t absolute_offset, - offset_t first_element_size, - offset_t element_size) - : OffsetBase( - sample, - absolute_offset, - first_element_size + element_size * (N - 1)), - first_element_size_(first_element_size), - element_size_(element_size) - { - } - - /** - * @brief Gets the Offset to an element - * - * @param i The zero-based index to the element - * @return The Offset to the element in the i-th position - */ - ElementOffset get_element(unsigned int i) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return ElementOffset()); - - if (i >= N) { - return ElementOffset(); // null offset - } - - offset_t element_offset = this->absolute_offset_; - if (i > 0) { - element_offset += this->first_element_size_ - + (i - 1) * this->element_size_; - } - - return ElementOffset(this->sample_, element_offset); - } - -private: - offset_t first_element_size_; - offset_t element_size_; -}; - -/** - * @ingroup RTIFlatOffsetsModule - * @brief Offset to an array of final elements - * - * @tparam ElementOffset A final struct Offset, such as MyFlatFinalOffset. - * @tparam N The array bound. For multidimensional arrays, \p N is the product - * of each dimension bound. - * - * Represents an Offset to an array member and allows getting an Offset to - * each of its elements. - * - * The following code shows how to use a FinalAlignedArrayOffset to initialize - * an array member with MyFlatMutableBuilder: - * - * \code - * MyFlatMutableBuilder builder = rti::flat::build_data(writer); - * auto array_offset = builder.add_my_final_array(); - * for (MyFlatFinalOffset element_offset : array_offset) { - * element_offset.my_primitive(3); - * // ... - * } - * - * // Or access an element directly: - * auto element_offset = array_offset.get_element(3); - * element_offset.my_primitive(3); - * \endcode - * - * A more efficient way to access a final array, provided it complies with - * the required preconditions, is through rti::flat::plain_cast(). - * - * FinalArrayOffset and FinalAlignedArrayOffset provide the same - * interface, but have different implementation details. FinalArrayOffset is - * used when the array member is part of a final type too, whereas - * FinalAlignedArrayOffset corresponds to an array inside a mutable type. - * - * A FinalAlignedArrayOffset may meet the requirements to be cast to an array of - * the equivalent plain C++ element type (see rti::flat::plain_cast()). - * - * @see MutableArrayOffset encapsulates arrays of variable-size elements - */ -template -class FinalAlignedArrayOffset : public AbstractAlignedList { -public: - typedef fixed_size_type_tag_t offset_kind; - - FinalAlignedArrayOffset() - { - } - - // Constructor used when this array is part of a mutable type, and - // therefore it's aligned to 4 always - FinalAlignedArrayOffset( - rti::flat::SampleBase *sample, - offset_t absolute_offset) - : AbstractAlignedList( - sample, - absolute_offset - + detail::collection_dheader_traits< - false>::dheader_size(), - serialized_size(0)) - { } - - // serialized_size() only works when this array is part of a mutable type - // and we know it's aligned to 4 - static offset_t serialized_size(offset_t) - { - // [element1][pad][element2][pad]...[elementN] - return ElementOffset::serialized_size_w_padding() * (N - 1) - + ElementOffset::serialized_size(0); - } - - /** - * @brief Gets the Offset to an element - * - * @param i The zero-based index to the element - * @return The Offset to the element in the i-th position - * - * @see rti::flat::plain_cast() for a method to access all the elements at - * once - */ - ElementOffset get_element(unsigned int i) - { - RTI_FLAT_OFFSET_CHECK_NOT_NULL(return ElementOffset()); - - if (i >= N) { - return ElementOffset(); - } - - return AbstractAlignedList::get_element(i); - } -}; - -namespace detail { - -// Arrays of complex elements may need a DHEADER -template -struct is_fixed_type_w_dheader > { - static bool value() - { - return is_dheader_required_in_non_primitive_collections(); - } -}; - - -} // namespace detail - -}} // namespace rti::flat - -#endif // RTI_DDS_FLAT_SEQUENCEOFFSETS_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/flat/rtiflat.hpp b/qt6-after/qt6-migrated-legatus/include/rti/flat/rtiflat.hpp deleted file mode 100644 index eb78c0c3a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/flat/rtiflat.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/* -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -// Note: this file shouldn't be included directly. Include the header for the -// corresponding C++ API: -// -// - Modern C++ API: "rti/topic/flat/FlatData.hpp" -// - Traditional C++ API: "ndds/ndds_flat_data_cpp.h" - -#ifndef RTI_DDS_FLAT_RTIFLAT_HPP_ -#define RTI_DDS_FLAT_RTIFLAT_HPP_ - -/** - * @defgroup RTIFlatDataModule FlatData Topic-Types - * @ingroup DDSTopicModule - * @brief @st_ext FlatData Language Binding for IDL topic-types - * - * @note For a complete description of the FlatData language binding and its - * benefits, and a tutorial, see the "Sending Large Data" chapter in the - * \ndds User's Manual. - * - * @note For buildable code examples, - * see https://community.rti.com/kb/flatdata-and-zerocopy-examples. - * - * @note The FlatData language binding is available in the Traditional C++ API - * and in the Modern C++ API. - * - * RTI FlatData™ is a language binding for IDL types in which the in-memory - * representation of a sample matches the wire representation. Therefore, the - * cost of serialization/deserialization is zero. - * - * To select FlatData as the language binding of a type, annotate it with - * \p \@language_binding(FLAT_DATA) in IDL or apply the attribute - * \p languageBinding="flat_data" in XML. - * - * There are some restrictions regarding the kinds of types to which the - * FlatData language binding can be applied. - * - * - For final types, the FlatData language binding can be applied only to - * fixed-size types. A fixed-size type is a type whose wire representation - * always has the same size. This includes primitive types, arrays of - * fixed-size types, and structs containing only members of fixed-size types. - * Unions are not fixed-size types. - * - For mutable types, any member is permitted. - * - Extensible types cannot be marked as FlatData. - * - * Final types are more efficient, but more restrictive. In general, a good - * compromise is to define mutable top-level types, but making sure their - * largest data members are final. - * - * When a type is marked with the FlatData language binding, its mapping into - * C++ is different than that of a regular type (plain language binding). Rather - * than a single C++ class with direct access to its members, for a FlatData - * type \nddsgen generates the following: - * - * \li A \ref RTIFlatSampleModule "Sample", the data in serialized format - * \li An \ref RTIFlatOffsetsModule "Offset", which allows reading the data - * members of that type inside a Sample, and modifying them without changing - * the size - * \li A \ref RTIFlatBuildersModule "Builder", if the type is mutable, which - * allows creating a variable-size Sample - * - * For example, for the IDL types \ref MyFlatFinal and \ref MyFlatMutable - * \nddsgen generates the following C++ types: - * \li The Sample types \ref MyFlatFinal and \ref MyFlatMutable - * \li The Offset types MyFlatFinalOffset and MyFlatMutableOffset. - * \li The Builder type MyFlatMutableBuilder. - * - * @section PublishingFlatData Publishing FlatData - * The typical way to publish FlatData samples includes the following steps: - * - Create a \idref_FooDataWriter as you would for a non-FlatData (plain) - * topic-type (see \ref DDSWriterExampleModule_writer_setup). - * - * (For final topic-types such as \ref MyFlatFinal) - * - Obtain a FlatData sample with \idref_FooDataWriter_get_loan. - * \code - * MyFlatFinal *foo_sample = writer.get_loan(); - * \endcode - * - * - Initialize the sample, starting from the \ref rti::flat::Sample::root "root()" offset. - * \code - * MyFlatFinalOffset foo_root = foo_sample->root(); - * foo_root.my_primitive(3); - * auto my_complex_offset = foo_root.my_complex(); - * // ... initialize my_complex_offset - * \endcode - * - * (For mutable topic-types such as \ref MyFlatMutable) - * - Obtain a \ref RTIFlatBuildersModule "Builder" to create a variable-size - * sample with rti::flat::build_data(). - * \code - * MyFlatMutableBuilder foo_builder = rti::flat::build_data(writer); - * \endcode - * - * - Use this builder (and possibly nested member builders) to initialize the - * members. - * \code - * foo_builder.add_my_primitive(3); - * auto my_mutable_builder = foo_builder.build_my_mutable(); - * // ... build 'my_mutable' (a member with a mutable type) - * my_mutable_builder.finish(); // completes a member - * auto my_final_offset = foo_builder.add_my_final(); - * // ... initialize 'my_final' (a member with a final type) - * \endcode - * - * - Obtain the completed sample with MyFlatMutableBuilder::finish_sample(). After - * that, the builder is no longer usable, and the sample size cannot change. - * \code - * MyFlatMutable *foo_sample = foo_builder.finish_sample(); - * \endcode - * - Optionally, it is possible to change the values of the sample accessing - * its root(), as long as the size doesn't change. For example, if the sample - * was built with a sequence member with two elements, it is possible to modify - * any of those elements, but it's not possible to add a third element. - * - * (For both final and mutable topic-types) - * - Write the sample with \idref_FooDataWriter_write. - * \code - * writer.write(*foo_sample); - * \endcode - * - * After write, the DataWriter owns the FlatData sample. This allows avoiding - * additional copies, the main goal of the FlatData language binding. This - * means that the sample cannot be reused. The DataWriter will return it to the - * sample pool when appropriate, as described in \idref_FooDataWriter_get_loan. - * - * @section SubscribingFlatData Subscribing to FlatData - * - * To subscribe to a topic using a FlatData topic-type: - * - Create a \idref_FooDataReader normally (see - * \ref DDSReaderExampleModule_reader_setup). - * - Read or take the samples using a loaning operation, such as - * \idref_FooDataReader_take (copying read/take operations cannot be used - * with FlatData types). - * - Access the \ref rti::flat::Sample::root "root()" offset, and any of the - * sample's members from there. - * - * Note that the language binding is a local concept. It is possible - * to publish with a FlatData topic-type and subscribe to it with a plain - * topic-type with the same (or assignable) definition. It is also possible to - * use a plain topic-type on the publisher side and subscribe to it using FlatData. - * The DataWriter or DataReader of the plain topic-type has to use - * \idref_XCDR2_DATA_REPRESENTATION in \idref_DataRepresentationQosPolicy. - * - */ - -#ifdef DOXYGEN_DOCUMENTATION_ONLY -namespace rti { - - /** - * @brief \st_ext Support for \ref RTIFlatDataModule - */ - namespace flat { - } -} -#endif - -#include "rti/flat/ExceptionHelper.hpp" -#include "rti/flat/FlatSample.hpp" -#include "rti/flat/FlatTypeTraits.hpp" -#include "rti/flat/SequenceBuilders.hpp" - -#endif // RTI_DDS_FLAT_RTIFLAT_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoring.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoring.hpp deleted file mode 100644 index efd4cf5d8..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoring.hpp +++ /dev/null @@ -1,2440 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from RecordingServiceMonitoring.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef RecordingServiceMonitoring_741490407_hpp -#define RecordingServiceMonitoring_741490407_hpp - -#include - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) && defined(RTI_WIN32) -#undef RTIUSERDllExport -#define RTIUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport __attribute__((visibility("default"))) -#endif - -#include "dds/core/SafeEnumeration.hpp" -#include "dds/core/String.hpp" -#include "dds/core/array.hpp" -#include "dds/core/vector.hpp" -#include "dds/core/External.hpp" -#include "rti/core/LongDouble.hpp" -#include "rti/core/Pointer.hpp" -#include "rti/core/array.hpp" -#include "rti/topic/TopicTraits.hpp" - -#include "omg/types/string_view.hpp" - -#include "rti/core/BoundedSequence.hpp" -#include "dds/core/Optional.hpp" - -#ifndef NDDS_STANDALONE_TYPE -#include "cdr/cdr_typeCode.h" -#include "dds/domain/DomainParticipant.hpp" -#include "dds/topic/TopicTraits.hpp" -#include "dds/core/xtypes/DynamicType.hpp" -#include "dds/core/xtypes/StructType.hpp" -#include "dds/core/xtypes/UnionType.hpp" -#include "dds/core/xtypes/EnumType.hpp" -#include "dds/core/xtypes/AliasType.hpp" -#include "rti/util/StreamFlagSaver.hpp" -#include "rti/domain/PluginSupport.hpp" -#endif - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport -#endif - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif -#include "ServiceCommon.hpp" -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif -namespace RTI { - namespace RecordingService { - namespace Monitoring { - using namespace ::RTI::Service; - using namespace ::RTI::Service::Monitoring; - - class NDDSUSERDllExport TopicConfig - : public ::RTI::Service::Monitoring::EntityConfig { - public: - - TopicConfig(); - - TopicConfig(const ::RTI::Service::ResourceId& m_resource_id__,const ::RTI::Service::XmlString& m_configuration__,const std::string& m_topic_name__,const std::string& m_registered_type_name__,const std::string& m_participant_name__,const ::RTI::Service::Monitoring::ResourceGuid& m_topic_group__); - - std::string& topic_name() noexcept { - return m_topic_name_; - } - - const std::string& topic_name() const noexcept { - return m_topic_name_; - } - - void topic_name(const std::string& value) { - - m_topic_name_ = value; - } - - void topic_name(std::string&& value) { - m_topic_name_ = std::move(value); - } - std::string& registered_type_name() noexcept { - return m_registered_type_name_; - } - - const std::string& registered_type_name() const noexcept { - return m_registered_type_name_; - } - - void registered_type_name(const std::string& value) { - - m_registered_type_name_ = value; - } - - void registered_type_name(std::string&& value) { - m_registered_type_name_ = std::move(value); - } - std::string& participant_name() noexcept { - return m_participant_name_; - } - - const std::string& participant_name() const noexcept { - return m_participant_name_; - } - - void participant_name(const std::string& value) { - - m_participant_name_ = value; - } - - void participant_name(std::string&& value) { - m_participant_name_ = std::move(value); - } - ::RTI::Service::Monitoring::ResourceGuid& topic_group() noexcept { - return m_topic_group_; - } - - const ::RTI::Service::Monitoring::ResourceGuid& topic_group() const noexcept { - return m_topic_group_; - } - - void topic_group(const ::RTI::Service::Monitoring::ResourceGuid& value) { - - m_topic_group_ = value; - } - - void topic_group(::RTI::Service::Monitoring::ResourceGuid&& value) { - m_topic_group_ = std::move(value); - } - bool operator == (const TopicConfig& other_) const; - bool operator != (const TopicConfig& other_) const; - - void swap(TopicConfig& other_) noexcept ; - - private: - - std::string m_topic_name_; - std::string m_registered_type_name_; - std::string m_participant_name_; - ::RTI::Service::Monitoring::ResourceGuid m_topic_group_; - - }; - - inline void swap(TopicConfig& a, TopicConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const TopicConfig& sample); - - class NDDSUSERDllExport TopicEvent - : public ::RTI::Service::Monitoring::EntityEvent { - public: - - TopicEvent(); - - explicit TopicEvent(const ::RTI::Service::EntityStateKind& m_state__,int32_t m__dummy__); - - int32_t& _dummy() noexcept { - return m__dummy_; - } - - const int32_t& _dummy() const noexcept { - return m__dummy_; - } - - void _dummy(int32_t value) { - - m__dummy_ = value; - } - - bool operator == (const TopicEvent& other_) const; - bool operator != (const TopicEvent& other_) const; - - void swap(TopicEvent& other_) noexcept ; - - private: - - int32_t m__dummy_; - - }; - - inline void swap(TopicEvent& a, TopicEvent& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const TopicEvent& sample); - - class NDDSUSERDllExport TopicPeriodic { - public: - - TopicPeriodic(); - - TopicPeriodic(const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& m_network_performance__,const ::dds::core::optional< ::RTI::Service::Monitoring::CountStatus >& m_matched_status__); - - ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& network_performance() noexcept { - return m_network_performance_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& network_performance() const noexcept { - return m_network_performance_; - } - - void network_performance(const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& value) { - - m_network_performance_ = value; - } - - void network_performance(::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >&& value) { - m_network_performance_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::CountStatus >& matched_status() noexcept { - return m_matched_status_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::CountStatus >& matched_status() const noexcept { - return m_matched_status_; - } - - void matched_status(const ::dds::core::optional< ::RTI::Service::Monitoring::CountStatus >& value) { - - m_matched_status_ = value; - } - - void matched_status(::dds::core::optional< ::RTI::Service::Monitoring::CountStatus >&& value) { - m_matched_status_ = std::move(value); - } - bool operator == (const TopicPeriodic& other_) const; - bool operator != (const TopicPeriodic& other_) const; - - void swap(TopicPeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance > m_network_performance_; - ::dds::core::optional< ::RTI::Service::Monitoring::CountStatus > m_matched_status_; - - }; - - inline void swap(TopicPeriodic& a, TopicPeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const TopicPeriodic& sample); - - class NDDSUSERDllExport TopicGroupConfig - : public ::RTI::Service::Monitoring::EntityConfig { - public: - - TopicGroupConfig(); - - explicit TopicGroupConfig(const ::RTI::Service::ResourceId& m_resource_id__,const ::RTI::Service::XmlString& m_configuration__,const std::string& m_participant_name__); - - std::string& participant_name() noexcept { - return m_participant_name_; - } - - const std::string& participant_name() const noexcept { - return m_participant_name_; - } - - void participant_name(const std::string& value) { - - m_participant_name_ = value; - } - - void participant_name(std::string&& value) { - m_participant_name_ = std::move(value); - } - bool operator == (const TopicGroupConfig& other_) const; - bool operator != (const TopicGroupConfig& other_) const; - - void swap(TopicGroupConfig& other_) noexcept ; - - private: - - std::string m_participant_name_; - - }; - - inline void swap(TopicGroupConfig& a, TopicGroupConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const TopicGroupConfig& sample); - - class NDDSUSERDllExport TopicGroupEvent - : public ::RTI::Service::Monitoring::EntityEvent { - public: - - TopicGroupEvent(); - - explicit TopicGroupEvent(const ::RTI::Service::EntityStateKind& m_state__,int32_t m__dummy__); - - int32_t& _dummy() noexcept { - return m__dummy_; - } - - const int32_t& _dummy() const noexcept { - return m__dummy_; - } - - void _dummy(int32_t value) { - - m__dummy_ = value; - } - - bool operator == (const TopicGroupEvent& other_) const; - bool operator != (const TopicGroupEvent& other_) const; - - void swap(TopicGroupEvent& other_) noexcept ; - - private: - - int32_t m__dummy_; - - }; - - inline void swap(TopicGroupEvent& a, TopicGroupEvent& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const TopicGroupEvent& sample); - - class NDDSUSERDllExport TopicGroupPeriodic { - public: - - TopicGroupPeriodic(); - - TopicGroupPeriodic(const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& m_network_performance__,int64_t m_topic_count__); - - ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& network_performance() noexcept { - return m_network_performance_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& network_performance() const noexcept { - return m_network_performance_; - } - - void network_performance(const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& value) { - - m_network_performance_ = value; - } - - void network_performance(::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >&& value) { - m_network_performance_ = std::move(value); - } - int64_t& topic_count() noexcept { - return m_topic_count_; - } - - const int64_t& topic_count() const noexcept { - return m_topic_count_; - } - - void topic_count(int64_t value) { - - m_topic_count_ = value; - } - - bool operator == (const TopicGroupPeriodic& other_) const; - bool operator != (const TopicGroupPeriodic& other_) const; - - void swap(TopicGroupPeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance > m_network_performance_; - int64_t m_topic_count_; - - }; - - inline void swap(TopicGroupPeriodic& a, TopicGroupPeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const TopicGroupPeriodic& sample); - - class NDDSUSERDllExport SessionConfig - : public ::RTI::Service::Monitoring::EntityConfig { - public: - - SessionConfig(); - - explicit SessionConfig(const ::RTI::Service::ResourceId& m_resource_id__,const ::RTI::Service::XmlString& m_configuration__,const std::string& m_default_participant_name__); - - std::string& default_participant_name() noexcept { - return m_default_participant_name_; - } - - const std::string& default_participant_name() const noexcept { - return m_default_participant_name_; - } - - void default_participant_name(const std::string& value) { - - m_default_participant_name_ = value; - } - - void default_participant_name(std::string&& value) { - m_default_participant_name_ = std::move(value); - } - bool operator == (const SessionConfig& other_) const; - bool operator != (const SessionConfig& other_) const; - - void swap(SessionConfig& other_) noexcept ; - - private: - - std::string m_default_participant_name_; - - }; - - inline void swap(SessionConfig& a, SessionConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const SessionConfig& sample); - - class NDDSUSERDllExport SessionEvent - : public ::RTI::Service::Monitoring::EntityEvent { - public: - - SessionEvent(); - - explicit SessionEvent(const ::RTI::Service::EntityStateKind& m_state__,int32_t m__dummy__); - - int32_t& _dummy() noexcept { - return m__dummy_; - } - - const int32_t& _dummy() const noexcept { - return m__dummy_; - } - - void _dummy(int32_t value) { - - m__dummy_ = value; - } - - bool operator == (const SessionEvent& other_) const; - bool operator != (const SessionEvent& other_) const; - - void swap(SessionEvent& other_) noexcept ; - - private: - - int32_t m__dummy_; - - }; - - inline void swap(SessionEvent& a, SessionEvent& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const SessionEvent& sample); - - class NDDSUSERDllExport SessionPeriodic { - public: - - SessionPeriodic(); - - SessionPeriodic(const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& m_network_performance__,const ::dds::core::optional< ::RTI::Service::Monitoring::ThreadPoolPeriodic >& m_thread_pool__); - - ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& network_performance() noexcept { - return m_network_performance_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& network_performance() const noexcept { - return m_network_performance_; - } - - void network_performance(const ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >& value) { - - m_network_performance_ = value; - } - - void network_performance(::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance >&& value) { - m_network_performance_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::ThreadPoolPeriodic >& thread_pool() noexcept { - return m_thread_pool_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::ThreadPoolPeriodic >& thread_pool() const noexcept { - return m_thread_pool_; - } - - void thread_pool(const ::dds::core::optional< ::RTI::Service::Monitoring::ThreadPoolPeriodic >& value) { - - m_thread_pool_ = value; - } - - void thread_pool(::dds::core::optional< ::RTI::Service::Monitoring::ThreadPoolPeriodic >&& value) { - m_thread_pool_ = std::move(value); - } - bool operator == (const SessionPeriodic& other_) const; - bool operator != (const SessionPeriodic& other_) const; - - void swap(SessionPeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::Service::Monitoring::NetworkPerformance > m_network_performance_; - ::dds::core::optional< ::RTI::Service::Monitoring::ThreadPoolPeriodic > m_thread_pool_; - - }; - - inline void swap(SessionPeriodic& a, SessionPeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const SessionPeriodic& sample); - - class NDDSUSERDllExport SqliteDatabaseConfig { - public: - - SqliteDatabaseConfig(); - - SqliteDatabaseConfig(const std::string& m_db_directory__,const ::dds::core::optional< std::string >& m_execution_directory_expression__,const ::dds::core::optional< std::string >& m_user_data_file_expression__); - - std::string& db_directory() noexcept { - return m_db_directory_; - } - - const std::string& db_directory() const noexcept { - return m_db_directory_; - } - - void db_directory(const std::string& value) { - - m_db_directory_ = value; - } - - void db_directory(std::string&& value) { - m_db_directory_ = std::move(value); - } - ::dds::core::optional< std::string >& execution_directory_expression() noexcept { - return m_execution_directory_expression_; - } - - const ::dds::core::optional< std::string >& execution_directory_expression() const noexcept { - return m_execution_directory_expression_; - } - - void execution_directory_expression(const ::dds::core::optional< std::string >& value) { - - m_execution_directory_expression_ = value; - } - - void execution_directory_expression(::dds::core::optional< std::string >&& value) { - m_execution_directory_expression_ = std::move(value); - } - ::dds::core::optional< std::string >& user_data_file_expression() noexcept { - return m_user_data_file_expression_; - } - - const ::dds::core::optional< std::string >& user_data_file_expression() const noexcept { - return m_user_data_file_expression_; - } - - void user_data_file_expression(const ::dds::core::optional< std::string >& value) { - - m_user_data_file_expression_ = value; - } - - void user_data_file_expression(::dds::core::optional< std::string >&& value) { - m_user_data_file_expression_ = std::move(value); - } - bool operator == (const SqliteDatabaseConfig& other_) const; - bool operator != (const SqliteDatabaseConfig& other_) const; - - void swap(SqliteDatabaseConfig& other_) noexcept ; - - private: - - std::string m_db_directory_; - ::dds::core::optional< std::string > m_execution_directory_expression_; - ::dds::core::optional< std::string > m_user_data_file_expression_; - - }; - - inline void swap(SqliteDatabaseConfig& a, SqliteDatabaseConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const SqliteDatabaseConfig& sample); - - class NDDSUSERDllExport SqliteDatabaseEvent { - public: - - SqliteDatabaseEvent(); - - SqliteDatabaseEvent(const ::dds::core::optional< std::string >& m_current_db_directory__,const ::dds::core::optional< std::string >& m_current_file__,const ::dds::core::optional< int32_t >& m_rollover_count__); - - ::dds::core::optional< std::string >& current_db_directory() noexcept { - return m_current_db_directory_; - } - - const ::dds::core::optional< std::string >& current_db_directory() const noexcept { - return m_current_db_directory_; - } - - void current_db_directory(const ::dds::core::optional< std::string >& value) { - - m_current_db_directory_ = value; - } - - void current_db_directory(::dds::core::optional< std::string >&& value) { - m_current_db_directory_ = std::move(value); - } - ::dds::core::optional< std::string >& current_file() noexcept { - return m_current_file_; - } - - const ::dds::core::optional< std::string >& current_file() const noexcept { - return m_current_file_; - } - - void current_file(const ::dds::core::optional< std::string >& value) { - - m_current_file_ = value; - } - - void current_file(::dds::core::optional< std::string >&& value) { - m_current_file_ = std::move(value); - } - ::dds::core::optional< int32_t >& rollover_count() noexcept { - return m_rollover_count_; - } - - const ::dds::core::optional< int32_t >& rollover_count() const noexcept { - return m_rollover_count_; - } - - void rollover_count(const ::dds::core::optional< int32_t >& value) { - - m_rollover_count_ = value; - } - - void rollover_count(::dds::core::optional< int32_t >&& value) { - m_rollover_count_ = std::move(value); - } - bool operator == (const SqliteDatabaseEvent& other_) const; - bool operator != (const SqliteDatabaseEvent& other_) const; - - void swap(SqliteDatabaseEvent& other_) noexcept ; - - private: - - ::dds::core::optional< std::string > m_current_db_directory_; - ::dds::core::optional< std::string > m_current_file_; - ::dds::core::optional< int32_t > m_rollover_count_; - - }; - - inline void swap(SqliteDatabaseEvent& a, SqliteDatabaseEvent& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const SqliteDatabaseEvent& sample); - - class NDDSUSERDllExport SqliteDatabasePeriodic { - public: - - SqliteDatabasePeriodic(); - - SqliteDatabasePeriodic(const ::dds::core::optional< std::string >& m_current_file__,const ::dds::core::optional< uint64_t >& m_current_file_size__,int32_t m_current_timestamp_sec__,uint32_t m_current_timestamp_nanosec__); - - ::dds::core::optional< std::string >& current_file() noexcept { - return m_current_file_; - } - - const ::dds::core::optional< std::string >& current_file() const noexcept { - return m_current_file_; - } - - void current_file(const ::dds::core::optional< std::string >& value) { - - m_current_file_ = value; - } - - void current_file(::dds::core::optional< std::string >&& value) { - m_current_file_ = std::move(value); - } - ::dds::core::optional< uint64_t >& current_file_size() noexcept { - return m_current_file_size_; - } - - const ::dds::core::optional< uint64_t >& current_file_size() const noexcept { - return m_current_file_size_; - } - - void current_file_size(const ::dds::core::optional< uint64_t >& value) { - - m_current_file_size_ = value; - } - - void current_file_size(::dds::core::optional< uint64_t >&& value) { - m_current_file_size_ = std::move(value); - } - int32_t& current_timestamp_sec() noexcept { - return m_current_timestamp_sec_; - } - - const int32_t& current_timestamp_sec() const noexcept { - return m_current_timestamp_sec_; - } - - void current_timestamp_sec(int32_t value) { - - m_current_timestamp_sec_ = value; - } - - uint32_t& current_timestamp_nanosec() noexcept { - return m_current_timestamp_nanosec_; - } - - const uint32_t& current_timestamp_nanosec() const noexcept { - return m_current_timestamp_nanosec_; - } - - void current_timestamp_nanosec(uint32_t value) { - - m_current_timestamp_nanosec_ = value; - } - - bool operator == (const SqliteDatabasePeriodic& other_) const; - bool operator != (const SqliteDatabasePeriodic& other_) const; - - void swap(SqliteDatabasePeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< std::string > m_current_file_; - ::dds::core::optional< uint64_t > m_current_file_size_; - int32_t m_current_timestamp_sec_; - uint32_t m_current_timestamp_nanosec_; - - }; - - inline void swap(SqliteDatabasePeriodic& a, SqliteDatabasePeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const SqliteDatabasePeriodic& sample); - - class NDDSUSERDllExport ParticipantInfo { - public: - - ParticipantInfo(); - - explicit ParticipantInfo(const std::string& m_name__); - - std::string& name() noexcept { - return m_name_; - } - - const std::string& name() const noexcept { - return m_name_; - } - - void name(const std::string& value) { - - m_name_ = value; - } - - void name(std::string&& value) { - m_name_ = std::move(value); - } - bool operator == (const ParticipantInfo& other_) const; - bool operator != (const ParticipantInfo& other_) const; - - void swap(ParticipantInfo& other_) noexcept ; - - private: - - std::string m_name_; - - }; - - inline void swap(ParticipantInfo& a, ParticipantInfo& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ParticipantInfo& sample); - - #if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) - // On Windows, dll-export template instantiations of standard types used by - // other dll-exported types - template class NDDSUSERDllExport std::allocator< ::RTI::RecordingService::Monitoring::ParticipantInfo >; - template class NDDSUSERDllExport std::vector< ::RTI::RecordingService::Monitoring::ParticipantInfo >; - #endif - class NDDSUSERDllExport ServiceConfig - : public ::RTI::Service::Monitoring::EntityConfig { - public: - - ServiceConfig(); - - ServiceConfig(const ::RTI::Service::ResourceId& m_resource_id__,const ::RTI::Service::XmlString& m_configuration__,const std::string& m_application_name__,const ::RTI::Service::Monitoring::ResourceGuid& m_application_guid__,const ::dds::core::optional< ::RTI::Service::Monitoring::HostConfig >& m_host__,const ::dds::core::optional< ::RTI::Service::Monitoring::ProcessConfig >& m_process__,const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig >& m_builtin_sqlite__,const ::dds::core::optional< std::vector< ::RTI::RecordingService::Monitoring::ParticipantInfo > >& m_participants__); - - std::string& application_name() noexcept { - return m_application_name_; - } - - const std::string& application_name() const noexcept { - return m_application_name_; - } - - void application_name(const std::string& value) { - - m_application_name_ = value; - } - - void application_name(std::string&& value) { - m_application_name_ = std::move(value); - } - ::RTI::Service::Monitoring::ResourceGuid& application_guid() noexcept { - return m_application_guid_; - } - - const ::RTI::Service::Monitoring::ResourceGuid& application_guid() const noexcept { - return m_application_guid_; - } - - void application_guid(const ::RTI::Service::Monitoring::ResourceGuid& value) { - - m_application_guid_ = value; - } - - void application_guid(::RTI::Service::Monitoring::ResourceGuid&& value) { - m_application_guid_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::HostConfig >& host() noexcept { - return m_host_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::HostConfig >& host() const noexcept { - return m_host_; - } - - void host(const ::dds::core::optional< ::RTI::Service::Monitoring::HostConfig >& value) { - - m_host_ = value; - } - - void host(::dds::core::optional< ::RTI::Service::Monitoring::HostConfig >&& value) { - m_host_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::ProcessConfig >& process() noexcept { - return m_process_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::ProcessConfig >& process() const noexcept { - return m_process_; - } - - void process(const ::dds::core::optional< ::RTI::Service::Monitoring::ProcessConfig >& value) { - - m_process_ = value; - } - - void process(::dds::core::optional< ::RTI::Service::Monitoring::ProcessConfig >&& value) { - m_process_ = std::move(value); - } - ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig >& builtin_sqlite() noexcept { - return m_builtin_sqlite_; - } - - const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig >& builtin_sqlite() const noexcept { - return m_builtin_sqlite_; - } - - void builtin_sqlite(const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig >& value) { - - m_builtin_sqlite_ = value; - } - - void builtin_sqlite(::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig >&& value) { - m_builtin_sqlite_ = std::move(value); - } - ::dds::core::optional< std::vector< ::RTI::RecordingService::Monitoring::ParticipantInfo > >& participants() noexcept { - return m_participants_; - } - - const ::dds::core::optional< std::vector< ::RTI::RecordingService::Monitoring::ParticipantInfo > >& participants() const noexcept { - return m_participants_; - } - - void participants(const ::dds::core::optional< std::vector< ::RTI::RecordingService::Monitoring::ParticipantInfo > >& value) { - - m_participants_ = value; - } - - void participants(::dds::core::optional< std::vector< ::RTI::RecordingService::Monitoring::ParticipantInfo > >&& value) { - m_participants_ = std::move(value); - } - bool operator == (const ServiceConfig& other_) const; - bool operator != (const ServiceConfig& other_) const; - - void swap(ServiceConfig& other_) noexcept ; - - private: - - std::string m_application_name_; - ::RTI::Service::Monitoring::ResourceGuid m_application_guid_; - ::dds::core::optional< ::RTI::Service::Monitoring::HostConfig > m_host_; - ::dds::core::optional< ::RTI::Service::Monitoring::ProcessConfig > m_process_; - ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig > m_builtin_sqlite_; - ::dds::core::optional< std::vector< ::RTI::RecordingService::Monitoring::ParticipantInfo > > m_participants_; - - }; - - inline void swap(ServiceConfig& a, ServiceConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ServiceConfig& sample); - - class NDDSUSERDllExport ServiceEvent - : public ::RTI::Service::Monitoring::EntityEvent { - public: - - ServiceEvent(); - - explicit ServiceEvent(const ::RTI::Service::EntityStateKind& m_state__,const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent >& m_builtin_sqlite__); - - ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent >& builtin_sqlite() noexcept { - return m_builtin_sqlite_; - } - - const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent >& builtin_sqlite() const noexcept { - return m_builtin_sqlite_; - } - - void builtin_sqlite(const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent >& value) { - - m_builtin_sqlite_ = value; - } - - void builtin_sqlite(::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent >&& value) { - m_builtin_sqlite_ = std::move(value); - } - bool operator == (const ServiceEvent& other_) const; - bool operator != (const ServiceEvent& other_) const; - - void swap(ServiceEvent& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent > m_builtin_sqlite_; - - }; - - inline void swap(ServiceEvent& a, ServiceEvent& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ServiceEvent& sample); - - class NDDSUSERDllExport ServicePeriodic { - public: - - ServicePeriodic(); - - ServicePeriodic(const ::dds::core::optional< ::RTI::Service::Monitoring::HostPeriodic >& m_host__,const ::dds::core::optional< ::RTI::Service::Monitoring::ProcessPeriodic >& m_process__,int64_t m_current_timestamp_nanos__,const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic >& m_builtin_sqlite__); - - ::dds::core::optional< ::RTI::Service::Monitoring::HostPeriodic >& host() noexcept { - return m_host_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::HostPeriodic >& host() const noexcept { - return m_host_; - } - - void host(const ::dds::core::optional< ::RTI::Service::Monitoring::HostPeriodic >& value) { - - m_host_ = value; - } - - void host(::dds::core::optional< ::RTI::Service::Monitoring::HostPeriodic >&& value) { - m_host_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::ProcessPeriodic >& process() noexcept { - return m_process_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::ProcessPeriodic >& process() const noexcept { - return m_process_; - } - - void process(const ::dds::core::optional< ::RTI::Service::Monitoring::ProcessPeriodic >& value) { - - m_process_ = value; - } - - void process(::dds::core::optional< ::RTI::Service::Monitoring::ProcessPeriodic >&& value) { - m_process_ = std::move(value); - } - int64_t& current_timestamp_nanos() noexcept { - return m_current_timestamp_nanos_; - } - - const int64_t& current_timestamp_nanos() const noexcept { - return m_current_timestamp_nanos_; - } - - void current_timestamp_nanos(int64_t value) { - - m_current_timestamp_nanos_ = value; - } - - ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic >& builtin_sqlite() noexcept { - return m_builtin_sqlite_; - } - - const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic >& builtin_sqlite() const noexcept { - return m_builtin_sqlite_; - } - - void builtin_sqlite(const ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic >& value) { - - m_builtin_sqlite_ = value; - } - - void builtin_sqlite(::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic >&& value) { - m_builtin_sqlite_ = std::move(value); - } - bool operator == (const ServicePeriodic& other_) const; - bool operator != (const ServicePeriodic& other_) const; - - void swap(ServicePeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::Service::Monitoring::HostPeriodic > m_host_; - ::dds::core::optional< ::RTI::Service::Monitoring::ProcessPeriodic > m_process_; - int64_t m_current_timestamp_nanos_; - ::dds::core::optional< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic > m_builtin_sqlite_; - - }; - - inline void swap(ServicePeriodic& a, ServicePeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ServicePeriodic& sample); - - class NDDSUSERDllExport ConfigUnion { - public: - - ConfigUnion(); - - ::RTI::Service::Monitoring::ResourceKind& _d() { - return m_d_; - } - - const ::RTI::Service::Monitoring::ResourceKind& _d() const { - return m_d_; - } - - void _d(::RTI::Service::Monitoring::ResourceKind value) { - - m_d_ = value; - } - - ::RTI::RecordingService::Monitoring::ServiceConfig& recording_service() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_service not selected by the discriminator" ); - } - return m_u_.m_recording_service_; - } - - const ::RTI::RecordingService::Monitoring::ServiceConfig& recording_service() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_service not selected by the discriminator" ); - } - return m_u_.m_recording_service_; - } - - void recording_service(const ::RTI::RecordingService::Monitoring::ServiceConfig& value) { - m_u_.m_recording_service_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE); - } - - void recording_service(::RTI::RecordingService::Monitoring::ServiceConfig&& value) { - m_u_.m_recording_service_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE); - } - ::RTI::RecordingService::Monitoring::SessionConfig& recording_session() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_session not selected by the discriminator" ); - } - return m_u_.m_recording_session_; - } - - const ::RTI::RecordingService::Monitoring::SessionConfig& recording_session() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_session not selected by the discriminator" ); - } - return m_u_.m_recording_session_; - } - - void recording_session(const ::RTI::RecordingService::Monitoring::SessionConfig& value) { - m_u_.m_recording_session_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION); - } - - void recording_session(::RTI::RecordingService::Monitoring::SessionConfig&& value) { - m_u_.m_recording_session_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION); - } - ::RTI::RecordingService::Monitoring::TopicGroupConfig& recording_topic_group() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_topic_group not selected by the discriminator" ); - } - return m_u_.m_recording_topic_group_; - } - - const ::RTI::RecordingService::Monitoring::TopicGroupConfig& recording_topic_group() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_topic_group not selected by the discriminator" ); - } - return m_u_.m_recording_topic_group_; - } - - void recording_topic_group(const ::RTI::RecordingService::Monitoring::TopicGroupConfig& value) { - m_u_.m_recording_topic_group_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP); - } - - void recording_topic_group(::RTI::RecordingService::Monitoring::TopicGroupConfig&& value) { - m_u_.m_recording_topic_group_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP); - } - ::RTI::RecordingService::Monitoring::TopicConfig& recording_topic() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_topic not selected by the discriminator" ); - } - return m_u_.m_recording_topic_; - } - - const ::RTI::RecordingService::Monitoring::TopicConfig& recording_topic() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::ConfigUnion::recording_topic not selected by the discriminator" ); - } - return m_u_.m_recording_topic_; - } - - void recording_topic(const ::RTI::RecordingService::Monitoring::TopicConfig& value) { - m_u_.m_recording_topic_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC); - } - - void recording_topic(::RTI::RecordingService::Monitoring::TopicConfig&& value) { - m_u_.m_recording_topic_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC); - } - bool operator == (const ConfigUnion& other_) const; - bool operator != (const ConfigUnion& other_) const; - static ::RTI::Service::Monitoring::ResourceKind default_discriminator(); - - void swap(ConfigUnion& other_) noexcept ; - - private: - - ::RTI::Service::Monitoring::ResourceKind m_d_; - struct NDDSUSERDllExport Union_ { - ::RTI::RecordingService::Monitoring::ServiceConfig m_recording_service_; - ::RTI::RecordingService::Monitoring::SessionConfig m_recording_session_; - ::RTI::RecordingService::Monitoring::TopicGroupConfig m_recording_topic_group_; - ::RTI::RecordingService::Monitoring::TopicConfig m_recording_topic_; - Union_(); - Union_(const ::RTI::RecordingService::Monitoring::ServiceConfig& m_recording_service__,const ::RTI::RecordingService::Monitoring::SessionConfig& m_recording_session__,const ::RTI::RecordingService::Monitoring::TopicGroupConfig& m_recording_topic_group__,const ::RTI::RecordingService::Monitoring::TopicConfig& m_recording_topic__); - }; - Union_ m_u_; - - }; - - inline void swap(ConfigUnion& a, ConfigUnion& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ConfigUnion& sample); - - class NDDSUSERDllExport Config - : public ::RTI::Service::Monitoring::KeyedResource { - public: - - Config(); - - explicit Config(const ::RTI::Service::Monitoring::ResourceGuid& m_object_guid__,const ::RTI::Service::Monitoring::ResourceGuid& m_owner_guid__,const ::RTI::RecordingService::Monitoring::ConfigUnion& m_value__); - - ::RTI::RecordingService::Monitoring::ConfigUnion& value() noexcept { - return m_value_; - } - - const ::RTI::RecordingService::Monitoring::ConfigUnion& value() const noexcept { - return m_value_; - } - - void value(const ::RTI::RecordingService::Monitoring::ConfigUnion& value) { - - m_value_ = value; - } - - void value(::RTI::RecordingService::Monitoring::ConfigUnion&& value) { - m_value_ = std::move(value); - } - bool operator == (const Config& other_) const; - bool operator != (const Config& other_) const; - - void swap(Config& other_) noexcept ; - - private: - - ::RTI::RecordingService::Monitoring::ConfigUnion m_value_; - - }; - - inline void swap(Config& a, Config& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const Config& sample); - - class NDDSUSERDllExport EventUnion { - public: - - EventUnion(); - - ::RTI::Service::Monitoring::ResourceKind& _d() { - return m_d_; - } - - const ::RTI::Service::Monitoring::ResourceKind& _d() const { - return m_d_; - } - - void _d(::RTI::Service::Monitoring::ResourceKind value) { - - m_d_ = value; - } - - ::RTI::RecordingService::Monitoring::ServiceEvent& recording_service() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_service not selected by the discriminator" ); - } - return m_u_.m_recording_service_; - } - - const ::RTI::RecordingService::Monitoring::ServiceEvent& recording_service() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_service not selected by the discriminator" ); - } - return m_u_.m_recording_service_; - } - - void recording_service(const ::RTI::RecordingService::Monitoring::ServiceEvent& value) { - m_u_.m_recording_service_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE); - } - - void recording_service(::RTI::RecordingService::Monitoring::ServiceEvent&& value) { - m_u_.m_recording_service_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE); - } - ::RTI::RecordingService::Monitoring::SessionEvent& recording_session() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_session not selected by the discriminator" ); - } - return m_u_.m_recording_session_; - } - - const ::RTI::RecordingService::Monitoring::SessionEvent& recording_session() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_session not selected by the discriminator" ); - } - return m_u_.m_recording_session_; - } - - void recording_session(const ::RTI::RecordingService::Monitoring::SessionEvent& value) { - m_u_.m_recording_session_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION); - } - - void recording_session(::RTI::RecordingService::Monitoring::SessionEvent&& value) { - m_u_.m_recording_session_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION); - } - ::RTI::RecordingService::Monitoring::TopicGroupEvent& recording_topic_group() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_topic_group not selected by the discriminator" ); - } - return m_u_.m_recording_topic_group_; - } - - const ::RTI::RecordingService::Monitoring::TopicGroupEvent& recording_topic_group() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_topic_group not selected by the discriminator" ); - } - return m_u_.m_recording_topic_group_; - } - - void recording_topic_group(const ::RTI::RecordingService::Monitoring::TopicGroupEvent& value) { - m_u_.m_recording_topic_group_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP); - } - - void recording_topic_group(::RTI::RecordingService::Monitoring::TopicGroupEvent&& value) { - m_u_.m_recording_topic_group_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP); - } - ::RTI::RecordingService::Monitoring::TopicEvent& recording_topic() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_topic not selected by the discriminator" ); - } - return m_u_.m_recording_topic_; - } - - const ::RTI::RecordingService::Monitoring::TopicEvent& recording_topic() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::EventUnion::recording_topic not selected by the discriminator" ); - } - return m_u_.m_recording_topic_; - } - - void recording_topic(const ::RTI::RecordingService::Monitoring::TopicEvent& value) { - m_u_.m_recording_topic_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC); - } - - void recording_topic(::RTI::RecordingService::Monitoring::TopicEvent&& value) { - m_u_.m_recording_topic_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC); - } - bool operator == (const EventUnion& other_) const; - bool operator != (const EventUnion& other_) const; - static ::RTI::Service::Monitoring::ResourceKind default_discriminator(); - - void swap(EventUnion& other_) noexcept ; - - private: - - ::RTI::Service::Monitoring::ResourceKind m_d_; - struct NDDSUSERDllExport Union_ { - ::RTI::RecordingService::Monitoring::ServiceEvent m_recording_service_; - ::RTI::RecordingService::Monitoring::SessionEvent m_recording_session_; - ::RTI::RecordingService::Monitoring::TopicGroupEvent m_recording_topic_group_; - ::RTI::RecordingService::Monitoring::TopicEvent m_recording_topic_; - Union_(); - Union_(const ::RTI::RecordingService::Monitoring::ServiceEvent& m_recording_service__,const ::RTI::RecordingService::Monitoring::SessionEvent& m_recording_session__,const ::RTI::RecordingService::Monitoring::TopicGroupEvent& m_recording_topic_group__,const ::RTI::RecordingService::Monitoring::TopicEvent& m_recording_topic__); - }; - Union_ m_u_; - - }; - - inline void swap(EventUnion& a, EventUnion& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const EventUnion& sample); - - class NDDSUSERDllExport Event - : public ::RTI::Service::Monitoring::KeyedResource { - public: - - Event(); - - explicit Event(const ::RTI::Service::Monitoring::ResourceGuid& m_object_guid__,const ::RTI::Service::Monitoring::ResourceGuid& m_owner_guid__,const ::RTI::RecordingService::Monitoring::EventUnion& m_value__); - - ::RTI::RecordingService::Monitoring::EventUnion& value() noexcept { - return m_value_; - } - - const ::RTI::RecordingService::Monitoring::EventUnion& value() const noexcept { - return m_value_; - } - - void value(const ::RTI::RecordingService::Monitoring::EventUnion& value) { - - m_value_ = value; - } - - void value(::RTI::RecordingService::Monitoring::EventUnion&& value) { - m_value_ = std::move(value); - } - bool operator == (const Event& other_) const; - bool operator != (const Event& other_) const; - - void swap(Event& other_) noexcept ; - - private: - - ::RTI::RecordingService::Monitoring::EventUnion m_value_; - - }; - - inline void swap(Event& a, Event& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const Event& sample); - - class NDDSUSERDllExport PeriodicUnion { - public: - - PeriodicUnion(); - - ::RTI::Service::Monitoring::ResourceKind& _d() { - return m_d_; - } - - const ::RTI::Service::Monitoring::ResourceKind& _d() const { - return m_d_; - } - - void _d(::RTI::Service::Monitoring::ResourceKind value) { - - m_d_ = value; - } - - ::RTI::RecordingService::Monitoring::ServicePeriodic& recording_service() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_service not selected by the discriminator" ); - } - return m_u_.m_recording_service_; - } - - const ::RTI::RecordingService::Monitoring::ServicePeriodic& recording_service() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_service not selected by the discriminator" ); - } - return m_u_.m_recording_service_; - } - - void recording_service(const ::RTI::RecordingService::Monitoring::ServicePeriodic& value) { - m_u_.m_recording_service_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE); - } - - void recording_service(::RTI::RecordingService::Monitoring::ServicePeriodic&& value) { - m_u_.m_recording_service_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SERVICE); - } - ::RTI::RecordingService::Monitoring::SessionPeriodic& recording_session() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_session not selected by the discriminator" ); - } - return m_u_.m_recording_session_; - } - - const ::RTI::RecordingService::Monitoring::SessionPeriodic& recording_session() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_session not selected by the discriminator" ); - } - return m_u_.m_recording_session_; - } - - void recording_session(const ::RTI::RecordingService::Monitoring::SessionPeriodic& value) { - m_u_.m_recording_session_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION); - } - - void recording_session(::RTI::RecordingService::Monitoring::SessionPeriodic&& value) { - m_u_.m_recording_session_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_SESSION); - } - ::RTI::RecordingService::Monitoring::TopicGroupPeriodic& recording_topic_group() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_topic_group not selected by the discriminator" ); - } - return m_u_.m_recording_topic_group_; - } - - const ::RTI::RecordingService::Monitoring::TopicGroupPeriodic& recording_topic_group() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_topic_group not selected by the discriminator" ); - } - return m_u_.m_recording_topic_group_; - } - - void recording_topic_group(const ::RTI::RecordingService::Monitoring::TopicGroupPeriodic& value) { - m_u_.m_recording_topic_group_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP); - } - - void recording_topic_group(::RTI::RecordingService::Monitoring::TopicGroupPeriodic&& value) { - m_u_.m_recording_topic_group_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC_GROUP); - } - ::RTI::RecordingService::Monitoring::TopicPeriodic& recording_topic() { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_topic not selected by the discriminator" ); - } - return m_u_.m_recording_topic_; - } - - const ::RTI::RecordingService::Monitoring::TopicPeriodic& recording_topic() const { - - if (_d() != (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::Monitoring::PeriodicUnion::recording_topic not selected by the discriminator" ); - } - return m_u_.m_recording_topic_; - } - - void recording_topic(const ::RTI::RecordingService::Monitoring::TopicPeriodic& value) { - m_u_.m_recording_topic_ = value; - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC); - } - - void recording_topic(::RTI::RecordingService::Monitoring::TopicPeriodic&& value) { - m_u_.m_recording_topic_ = std::move(value); - m_d_= (RTI::Service::Monitoring::ResourceKind::RECORDING_TOPIC); - } - bool operator == (const PeriodicUnion& other_) const; - bool operator != (const PeriodicUnion& other_) const; - static ::RTI::Service::Monitoring::ResourceKind default_discriminator(); - - void swap(PeriodicUnion& other_) noexcept ; - - private: - - ::RTI::Service::Monitoring::ResourceKind m_d_; - struct NDDSUSERDllExport Union_ { - ::RTI::RecordingService::Monitoring::ServicePeriodic m_recording_service_; - ::RTI::RecordingService::Monitoring::SessionPeriodic m_recording_session_; - ::RTI::RecordingService::Monitoring::TopicGroupPeriodic m_recording_topic_group_; - ::RTI::RecordingService::Monitoring::TopicPeriodic m_recording_topic_; - Union_(); - Union_(const ::RTI::RecordingService::Monitoring::ServicePeriodic& m_recording_service__,const ::RTI::RecordingService::Monitoring::SessionPeriodic& m_recording_session__,const ::RTI::RecordingService::Monitoring::TopicGroupPeriodic& m_recording_topic_group__,const ::RTI::RecordingService::Monitoring::TopicPeriodic& m_recording_topic__); - }; - Union_ m_u_; - - }; - - inline void swap(PeriodicUnion& a, PeriodicUnion& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const PeriodicUnion& sample); - - class NDDSUSERDllExport Periodic - : public ::RTI::Service::Monitoring::KeyedResource { - public: - - Periodic(); - - explicit Periodic(const ::RTI::Service::Monitoring::ResourceGuid& m_object_guid__,const ::RTI::Service::Monitoring::ResourceGuid& m_owner_guid__,const ::RTI::RecordingService::Monitoring::PeriodicUnion& m_value__); - - ::RTI::RecordingService::Monitoring::PeriodicUnion& value() noexcept { - return m_value_; - } - - const ::RTI::RecordingService::Monitoring::PeriodicUnion& value() const noexcept { - return m_value_; - } - - void value(const ::RTI::RecordingService::Monitoring::PeriodicUnion& value) { - - m_value_ = value; - } - - void value(::RTI::RecordingService::Monitoring::PeriodicUnion&& value) { - m_value_ = std::move(value); - } - bool operator == (const Periodic& other_) const; - bool operator != (const Periodic& other_) const; - - void swap(Periodic& other_) noexcept ; - - private: - - ::RTI::RecordingService::Monitoring::PeriodicUnion m_value_; - - }; - - inline void swap(Periodic& a, Periodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const Periodic& sample); - - } // namespace Monitoring - } // namespace RecordingService -} // namespace RTI - -#ifdef NDDS_STANDALONE_TYPE -namespace rti { - namespace topic { - } -} -#else - -namespace rti { - namespace flat { - namespace topic { - } - } -} -namespace dds { - namespace topic { - - using namespace ::RTI::Service; - using namespace ::RTI::Service::Monitoring; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::TopicConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::TopicConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::TopicConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::TopicConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::TopicConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::TopicEvent > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::TopicEvent"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::TopicEvent > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::TopicEvent& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::TopicEvent& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::TopicPeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::TopicPeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::TopicPeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::TopicPeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::TopicPeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::TopicGroupConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::TopicGroupConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::TopicGroupConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::TopicGroupConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::TopicGroupConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::TopicGroupEvent > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::TopicGroupEvent"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::TopicGroupEvent > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::TopicGroupEvent& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::TopicGroupEvent& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::TopicGroupPeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::TopicGroupPeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::TopicGroupPeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::TopicGroupPeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::TopicGroupPeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::SessionConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::SessionConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::SessionConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::SessionConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::SessionConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::SessionEvent > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::SessionEvent"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::SessionEvent > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::SessionEvent& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::SessionEvent& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::SessionPeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::SessionPeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::SessionPeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::SessionPeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::SessionPeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::SqliteDatabaseConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::SqliteDatabaseConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::SqliteDatabaseConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::SqliteDatabaseEvent"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::SqliteDatabaseEvent& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::SqliteDatabaseEvent& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::SqliteDatabasePeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::ParticipantInfo > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::ParticipantInfo"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::ParticipantInfo > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::ParticipantInfo& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::ParticipantInfo& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::ServiceConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::ServiceConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::ServiceConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::ServiceConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::ServiceConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::ServiceEvent > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::ServiceEvent"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::ServiceEvent > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::ServiceEvent& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::ServiceEvent& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::ServicePeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::ServicePeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::ServicePeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::ServicePeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::ServicePeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::ConfigUnion > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::ConfigUnion"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::ConfigUnion > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::ConfigUnion& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::ConfigUnion& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::Config > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::Config"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::Monitoring::Config > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::Config > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::Monitoring::Config& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::Monitoring::Config& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::Config& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::Config& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::EventUnion > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::EventUnion"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::EventUnion > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::EventUnion& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::EventUnion& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::Event > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::Event"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::Monitoring::Event > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::Event > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::Monitoring::Event& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::Monitoring::Event& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::Event& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::Event& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::PeriodicUnion > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::PeriodicUnion"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::PeriodicUnion > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::PeriodicUnion& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::PeriodicUnion& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::Monitoring::Periodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::Monitoring::Periodic"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::Monitoring::Periodic > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::Monitoring::Periodic > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::Monitoring::Periodic& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::Monitoring::Periodic& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::Monitoring::Periodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::Monitoring::Periodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - } -} - -namespace rti { - namespace topic { - - using namespace ::RTI::Service; - using namespace ::RTI::Service::Monitoring; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::TopicConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - using namespace ::RTI::Service; - using namespace ::RTI::Service::Monitoring; - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::TopicConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::TopicEvent > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::TopicEvent > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::TopicPeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::TopicPeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::TopicGroupConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::TopicGroupConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::TopicGroupEvent > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::TopicGroupEvent > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::TopicGroupPeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::TopicGroupPeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::SessionConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::SessionConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::SessionEvent > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::SessionEvent > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::SessionPeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::SessionPeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::SqliteDatabaseConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::SqliteDatabaseEvent > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::SqliteDatabasePeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::ParticipantInfo > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::ParticipantInfo > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::ServiceConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::ServiceConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::ServiceEvent > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::ServiceEvent > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::ServicePeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::ServicePeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::ConfigUnion > { - typedef ::dds::core::xtypes::UnionType type; - NDDSUSERDllExport static const ::dds::core::xtypes::UnionType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::ConfigUnion > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::Config > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::Config > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::EventUnion > { - typedef ::dds::core::xtypes::UnionType type; - NDDSUSERDllExport static const ::dds::core::xtypes::UnionType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::EventUnion > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::Event > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::Event > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::PeriodicUnion > { - typedef ::dds::core::xtypes::UnionType type; - NDDSUSERDllExport static const ::dds::core::xtypes::UnionType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::PeriodicUnion > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::Monitoring::Periodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::Monitoring::Periodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - } -} - -#endif // NDDS_STANDALONE_TYPE -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif // RecordingServiceMonitoring_741490407_hpp diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoringPlugin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoringPlugin.hpp deleted file mode 100644 index 4486a224f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceMonitoringPlugin.hpp +++ /dev/null @@ -1,2958 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from RecordingServiceMonitoring.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef RecordingServiceMonitoringPlugin_741490407_h -#define RecordingServiceMonitoringPlugin_741490407_h - -#include "RecordingServiceMonitoring.hpp" - -struct RTICdrStream; - -#ifndef pres_typePlugin_h -#include "pres/pres_typePlugin.h" -#endif - -#include "ServiceCommonPlugin.hpp" - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -namespace RTI { - namespace RecordingService { - namespace Monitoring { - using namespace ::RTI::Service; - using namespace ::RTI::Service::Monitoring; - - #define TopicConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define TopicConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define TopicConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define TopicConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define TopicConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern TopicConfig* - TopicConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern TopicConfig* - TopicConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern TopicConfig* - TopicConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - TopicConfigPluginSupport_copy_data( - TopicConfig *out, - const TopicConfig *in); - - NDDSUSERDllExport extern void - TopicConfigPluginSupport_destroy_data_w_params( - TopicConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - TopicConfigPluginSupport_destroy_data_ex( - TopicConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - TopicConfigPluginSupport_destroy_data( - TopicConfig *sample); - - NDDSUSERDllExport extern void - TopicConfigPluginSupport_print_data( - const TopicConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - TopicConfig *out, - const TopicConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const TopicConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - TopicConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - TopicConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - TopicConfigPlugin_deserialize_from_cdr_buffer( - TopicConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - TopicConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - TopicConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - TopicConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TopicConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - TopicConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - TopicConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define TopicEventPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define TopicEventPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define TopicEventPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define TopicEventPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define TopicEventPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern TopicEvent* - TopicEventPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern TopicEvent* - TopicEventPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern TopicEvent* - TopicEventPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - TopicEventPluginSupport_copy_data( - TopicEvent *out, - const TopicEvent *in); - - NDDSUSERDllExport extern void - TopicEventPluginSupport_destroy_data_w_params( - TopicEvent *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - TopicEventPluginSupport_destroy_data_ex( - TopicEvent *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - TopicEventPluginSupport_destroy_data( - TopicEvent *sample); - - NDDSUSERDllExport extern void - TopicEventPluginSupport_print_data( - const TopicEvent *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicEventPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - TopicEvent *out, - const TopicEvent *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicEventPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const TopicEvent *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - TopicEventPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - TopicEvent **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - TopicEventPlugin_deserialize_from_cdr_buffer( - TopicEvent *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - TopicEventPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - TopicEventPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - TopicEventPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TopicEventPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - TopicEventPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - TopicEvent ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define TopicPeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define TopicPeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define TopicPeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define TopicPeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define TopicPeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern TopicPeriodic* - TopicPeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern TopicPeriodic* - TopicPeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern TopicPeriodic* - TopicPeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - TopicPeriodicPluginSupport_copy_data( - TopicPeriodic *out, - const TopicPeriodic *in); - - NDDSUSERDllExport extern void - TopicPeriodicPluginSupport_destroy_data_w_params( - TopicPeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - TopicPeriodicPluginSupport_destroy_data_ex( - TopicPeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - TopicPeriodicPluginSupport_destroy_data( - TopicPeriodic *sample); - - NDDSUSERDllExport extern void - TopicPeriodicPluginSupport_print_data( - const TopicPeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicPeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - TopicPeriodic *out, - const TopicPeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicPeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const TopicPeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - TopicPeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - TopicPeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - TopicPeriodicPlugin_deserialize_from_cdr_buffer( - TopicPeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - TopicPeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - TopicPeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - TopicPeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TopicPeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - TopicPeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - TopicPeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define TopicGroupConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define TopicGroupConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define TopicGroupConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define TopicGroupConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define TopicGroupConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern TopicGroupConfig* - TopicGroupConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern TopicGroupConfig* - TopicGroupConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern TopicGroupConfig* - TopicGroupConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - TopicGroupConfigPluginSupport_copy_data( - TopicGroupConfig *out, - const TopicGroupConfig *in); - - NDDSUSERDllExport extern void - TopicGroupConfigPluginSupport_destroy_data_w_params( - TopicGroupConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - TopicGroupConfigPluginSupport_destroy_data_ex( - TopicGroupConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - TopicGroupConfigPluginSupport_destroy_data( - TopicGroupConfig *sample); - - NDDSUSERDllExport extern void - TopicGroupConfigPluginSupport_print_data( - const TopicGroupConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicGroupConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - TopicGroupConfig *out, - const TopicGroupConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicGroupConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const TopicGroupConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - TopicGroupConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - TopicGroupConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - TopicGroupConfigPlugin_deserialize_from_cdr_buffer( - TopicGroupConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - TopicGroupConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - TopicGroupConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - TopicGroupConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TopicGroupConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - TopicGroupConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - TopicGroupConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define TopicGroupEventPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define TopicGroupEventPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define TopicGroupEventPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define TopicGroupEventPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define TopicGroupEventPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern TopicGroupEvent* - TopicGroupEventPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern TopicGroupEvent* - TopicGroupEventPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern TopicGroupEvent* - TopicGroupEventPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - TopicGroupEventPluginSupport_copy_data( - TopicGroupEvent *out, - const TopicGroupEvent *in); - - NDDSUSERDllExport extern void - TopicGroupEventPluginSupport_destroy_data_w_params( - TopicGroupEvent *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - TopicGroupEventPluginSupport_destroy_data_ex( - TopicGroupEvent *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - TopicGroupEventPluginSupport_destroy_data( - TopicGroupEvent *sample); - - NDDSUSERDllExport extern void - TopicGroupEventPluginSupport_print_data( - const TopicGroupEvent *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicGroupEventPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - TopicGroupEvent *out, - const TopicGroupEvent *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicGroupEventPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const TopicGroupEvent *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - TopicGroupEventPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - TopicGroupEvent **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - TopicGroupEventPlugin_deserialize_from_cdr_buffer( - TopicGroupEvent *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - TopicGroupEventPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - TopicGroupEventPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - TopicGroupEventPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TopicGroupEventPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - TopicGroupEventPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - TopicGroupEvent ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define TopicGroupPeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define TopicGroupPeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define TopicGroupPeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define TopicGroupPeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define TopicGroupPeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern TopicGroupPeriodic* - TopicGroupPeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern TopicGroupPeriodic* - TopicGroupPeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern TopicGroupPeriodic* - TopicGroupPeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - TopicGroupPeriodicPluginSupport_copy_data( - TopicGroupPeriodic *out, - const TopicGroupPeriodic *in); - - NDDSUSERDllExport extern void - TopicGroupPeriodicPluginSupport_destroy_data_w_params( - TopicGroupPeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - TopicGroupPeriodicPluginSupport_destroy_data_ex( - TopicGroupPeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - TopicGroupPeriodicPluginSupport_destroy_data( - TopicGroupPeriodic *sample); - - NDDSUSERDllExport extern void - TopicGroupPeriodicPluginSupport_print_data( - const TopicGroupPeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicGroupPeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - TopicGroupPeriodic *out, - const TopicGroupPeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TopicGroupPeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const TopicGroupPeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - TopicGroupPeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - TopicGroupPeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - TopicGroupPeriodicPlugin_deserialize_from_cdr_buffer( - TopicGroupPeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - TopicGroupPeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - TopicGroupPeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - TopicGroupPeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TopicGroupPeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - TopicGroupPeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - TopicGroupPeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define SessionConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define SessionConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define SessionConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define SessionConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define SessionConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern SessionConfig* - SessionConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern SessionConfig* - SessionConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern SessionConfig* - SessionConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - SessionConfigPluginSupport_copy_data( - SessionConfig *out, - const SessionConfig *in); - - NDDSUSERDllExport extern void - SessionConfigPluginSupport_destroy_data_w_params( - SessionConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - SessionConfigPluginSupport_destroy_data_ex( - SessionConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - SessionConfigPluginSupport_destroy_data( - SessionConfig *sample); - - NDDSUSERDllExport extern void - SessionConfigPluginSupport_print_data( - const SessionConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SessionConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - SessionConfig *out, - const SessionConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SessionConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const SessionConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - SessionConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - SessionConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - SessionConfigPlugin_deserialize_from_cdr_buffer( - SessionConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - SessionConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - SessionConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - SessionConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - SessionConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - SessionConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - SessionConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define SessionEventPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define SessionEventPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define SessionEventPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define SessionEventPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define SessionEventPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern SessionEvent* - SessionEventPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern SessionEvent* - SessionEventPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern SessionEvent* - SessionEventPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - SessionEventPluginSupport_copy_data( - SessionEvent *out, - const SessionEvent *in); - - NDDSUSERDllExport extern void - SessionEventPluginSupport_destroy_data_w_params( - SessionEvent *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - SessionEventPluginSupport_destroy_data_ex( - SessionEvent *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - SessionEventPluginSupport_destroy_data( - SessionEvent *sample); - - NDDSUSERDllExport extern void - SessionEventPluginSupport_print_data( - const SessionEvent *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SessionEventPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - SessionEvent *out, - const SessionEvent *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SessionEventPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const SessionEvent *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - SessionEventPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - SessionEvent **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - SessionEventPlugin_deserialize_from_cdr_buffer( - SessionEvent *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - SessionEventPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - SessionEventPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - SessionEventPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - SessionEventPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - SessionEventPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - SessionEvent ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define SessionPeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define SessionPeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define SessionPeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define SessionPeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define SessionPeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern SessionPeriodic* - SessionPeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern SessionPeriodic* - SessionPeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern SessionPeriodic* - SessionPeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - SessionPeriodicPluginSupport_copy_data( - SessionPeriodic *out, - const SessionPeriodic *in); - - NDDSUSERDllExport extern void - SessionPeriodicPluginSupport_destroy_data_w_params( - SessionPeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - SessionPeriodicPluginSupport_destroy_data_ex( - SessionPeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - SessionPeriodicPluginSupport_destroy_data( - SessionPeriodic *sample); - - NDDSUSERDllExport extern void - SessionPeriodicPluginSupport_print_data( - const SessionPeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SessionPeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - SessionPeriodic *out, - const SessionPeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SessionPeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const SessionPeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - SessionPeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - SessionPeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - SessionPeriodicPlugin_deserialize_from_cdr_buffer( - SessionPeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - SessionPeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - SessionPeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - SessionPeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - SessionPeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - SessionPeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - SessionPeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define SqliteDatabaseConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define SqliteDatabaseConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define SqliteDatabaseConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define SqliteDatabaseConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define SqliteDatabaseConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern SqliteDatabaseConfig* - SqliteDatabaseConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern SqliteDatabaseConfig* - SqliteDatabaseConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern SqliteDatabaseConfig* - SqliteDatabaseConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseConfigPluginSupport_copy_data( - SqliteDatabaseConfig *out, - const SqliteDatabaseConfig *in); - - NDDSUSERDllExport extern void - SqliteDatabaseConfigPluginSupport_destroy_data_w_params( - SqliteDatabaseConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - SqliteDatabaseConfigPluginSupport_destroy_data_ex( - SqliteDatabaseConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - SqliteDatabaseConfigPluginSupport_destroy_data( - SqliteDatabaseConfig *sample); - - NDDSUSERDllExport extern void - SqliteDatabaseConfigPluginSupport_print_data( - const SqliteDatabaseConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabaseConfig *out, - const SqliteDatabaseConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const SqliteDatabaseConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabaseConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseConfigPlugin_deserialize_from_cdr_buffer( - SqliteDatabaseConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - SqliteDatabaseConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - SqliteDatabaseConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - SqliteDatabaseConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - SqliteDatabaseConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabaseConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define SqliteDatabaseEventPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define SqliteDatabaseEventPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define SqliteDatabaseEventPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define SqliteDatabaseEventPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define SqliteDatabaseEventPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern SqliteDatabaseEvent* - SqliteDatabaseEventPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern SqliteDatabaseEvent* - SqliteDatabaseEventPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern SqliteDatabaseEvent* - SqliteDatabaseEventPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseEventPluginSupport_copy_data( - SqliteDatabaseEvent *out, - const SqliteDatabaseEvent *in); - - NDDSUSERDllExport extern void - SqliteDatabaseEventPluginSupport_destroy_data_w_params( - SqliteDatabaseEvent *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - SqliteDatabaseEventPluginSupport_destroy_data_ex( - SqliteDatabaseEvent *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - SqliteDatabaseEventPluginSupport_destroy_data( - SqliteDatabaseEvent *sample); - - NDDSUSERDllExport extern void - SqliteDatabaseEventPluginSupport_print_data( - const SqliteDatabaseEvent *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseEventPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabaseEvent *out, - const SqliteDatabaseEvent *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseEventPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const SqliteDatabaseEvent *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseEventPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabaseEvent **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseEventPlugin_deserialize_from_cdr_buffer( - SqliteDatabaseEvent *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - SqliteDatabaseEventPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - SqliteDatabaseEventPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - SqliteDatabaseEventPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - SqliteDatabaseEventPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - SqliteDatabaseEventPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabaseEvent ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define SqliteDatabasePeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define SqliteDatabasePeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define SqliteDatabasePeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define SqliteDatabasePeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define SqliteDatabasePeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern SqliteDatabasePeriodic* - SqliteDatabasePeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern SqliteDatabasePeriodic* - SqliteDatabasePeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern SqliteDatabasePeriodic* - SqliteDatabasePeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - SqliteDatabasePeriodicPluginSupport_copy_data( - SqliteDatabasePeriodic *out, - const SqliteDatabasePeriodic *in); - - NDDSUSERDllExport extern void - SqliteDatabasePeriodicPluginSupport_destroy_data_w_params( - SqliteDatabasePeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - SqliteDatabasePeriodicPluginSupport_destroy_data_ex( - SqliteDatabasePeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - SqliteDatabasePeriodicPluginSupport_destroy_data( - SqliteDatabasePeriodic *sample); - - NDDSUSERDllExport extern void - SqliteDatabasePeriodicPluginSupport_print_data( - const SqliteDatabasePeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SqliteDatabasePeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabasePeriodic *out, - const SqliteDatabasePeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - SqliteDatabasePeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const SqliteDatabasePeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - SqliteDatabasePeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabasePeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - SqliteDatabasePeriodicPlugin_deserialize_from_cdr_buffer( - SqliteDatabasePeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - SqliteDatabasePeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - SqliteDatabasePeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - SqliteDatabasePeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - SqliteDatabasePeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - SqliteDatabasePeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - SqliteDatabasePeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ParticipantInfoPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ParticipantInfoPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ParticipantInfoPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ParticipantInfoPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ParticipantInfoPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ParticipantInfo* - ParticipantInfoPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ParticipantInfo* - ParticipantInfoPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ParticipantInfo* - ParticipantInfoPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ParticipantInfoPluginSupport_copy_data( - ParticipantInfo *out, - const ParticipantInfo *in); - - NDDSUSERDllExport extern void - ParticipantInfoPluginSupport_destroy_data_w_params( - ParticipantInfo *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ParticipantInfoPluginSupport_destroy_data_ex( - ParticipantInfo *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ParticipantInfoPluginSupport_destroy_data( - ParticipantInfo *sample); - - NDDSUSERDllExport extern void - ParticipantInfoPluginSupport_print_data( - const ParticipantInfo *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ParticipantInfoPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ParticipantInfo *out, - const ParticipantInfo *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ParticipantInfoPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ParticipantInfo *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ParticipantInfoPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ParticipantInfo **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ParticipantInfoPlugin_deserialize_from_cdr_buffer( - ParticipantInfo *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ParticipantInfoPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ParticipantInfoPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ParticipantInfoPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ParticipantInfoPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ParticipantInfoPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ParticipantInfo ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ServiceConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ServiceConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ServiceConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ServiceConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ServiceConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ServiceConfig* - ServiceConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ServiceConfig* - ServiceConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ServiceConfig* - ServiceConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ServiceConfigPluginSupport_copy_data( - ServiceConfig *out, - const ServiceConfig *in); - - NDDSUSERDllExport extern void - ServiceConfigPluginSupport_destroy_data_w_params( - ServiceConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ServiceConfigPluginSupport_destroy_data_ex( - ServiceConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ServiceConfigPluginSupport_destroy_data( - ServiceConfig *sample); - - NDDSUSERDllExport extern void - ServiceConfigPluginSupport_print_data( - const ServiceConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ServiceConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ServiceConfig *out, - const ServiceConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ServiceConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ServiceConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ServiceConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ServiceConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ServiceConfigPlugin_deserialize_from_cdr_buffer( - ServiceConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ServiceConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ServiceConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ServiceConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ServiceConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ServiceConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ServiceConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ServiceEventPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ServiceEventPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ServiceEventPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ServiceEventPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ServiceEventPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ServiceEvent* - ServiceEventPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ServiceEvent* - ServiceEventPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ServiceEvent* - ServiceEventPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ServiceEventPluginSupport_copy_data( - ServiceEvent *out, - const ServiceEvent *in); - - NDDSUSERDllExport extern void - ServiceEventPluginSupport_destroy_data_w_params( - ServiceEvent *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ServiceEventPluginSupport_destroy_data_ex( - ServiceEvent *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ServiceEventPluginSupport_destroy_data( - ServiceEvent *sample); - - NDDSUSERDllExport extern void - ServiceEventPluginSupport_print_data( - const ServiceEvent *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ServiceEventPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ServiceEvent *out, - const ServiceEvent *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ServiceEventPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ServiceEvent *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ServiceEventPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ServiceEvent **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ServiceEventPlugin_deserialize_from_cdr_buffer( - ServiceEvent *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ServiceEventPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ServiceEventPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ServiceEventPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ServiceEventPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ServiceEventPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ServiceEvent ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ServicePeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ServicePeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ServicePeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ServicePeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ServicePeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ServicePeriodic* - ServicePeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ServicePeriodic* - ServicePeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ServicePeriodic* - ServicePeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ServicePeriodicPluginSupport_copy_data( - ServicePeriodic *out, - const ServicePeriodic *in); - - NDDSUSERDllExport extern void - ServicePeriodicPluginSupport_destroy_data_w_params( - ServicePeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ServicePeriodicPluginSupport_destroy_data_ex( - ServicePeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ServicePeriodicPluginSupport_destroy_data( - ServicePeriodic *sample); - - NDDSUSERDllExport extern void - ServicePeriodicPluginSupport_print_data( - const ServicePeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ServicePeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ServicePeriodic *out, - const ServicePeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ServicePeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ServicePeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ServicePeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ServicePeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ServicePeriodicPlugin_deserialize_from_cdr_buffer( - ServicePeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ServicePeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ServicePeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ServicePeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ServicePeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ServicePeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ServicePeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ConfigUnionPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ConfigUnionPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ConfigUnionPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ConfigUnionPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ConfigUnionPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ConfigUnion* - ConfigUnionPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ConfigUnion* - ConfigUnionPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ConfigUnion* - ConfigUnionPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ConfigUnionPluginSupport_copy_data( - ConfigUnion *out, - const ConfigUnion *in); - - NDDSUSERDllExport extern void - ConfigUnionPluginSupport_destroy_data_w_params( - ConfigUnion *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ConfigUnionPluginSupport_destroy_data_ex( - ConfigUnion *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ConfigUnionPluginSupport_destroy_data( - ConfigUnion *sample); - - NDDSUSERDllExport extern void - ConfigUnionPluginSupport_print_data( - const ConfigUnion *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ConfigUnionPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ConfigUnion *out, - const ConfigUnion *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ConfigUnionPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ConfigUnion *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ConfigUnionPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ConfigUnion **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ConfigUnionPlugin_deserialize_from_cdr_buffer( - ConfigUnion *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ConfigUnionPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ConfigUnionPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ConfigUnionPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ConfigUnionPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ConfigUnionPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ConfigUnion ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* The type used to store keys for instances of type struct - * AnotherSimple. - * - * By default, this type is struct Config - * itself. However, if for some reason this choice is not practical for your - * system (e.g. if sizeof(struct Config) - * is very large), you may redefine this typedef in terms of another type of - * your choosing. HOWEVER, if you define the KeyHolder type to be something - * other than struct AnotherSimple, the - * following restriction applies: the key of struct - * Config must consist of a - * single field of your redefined KeyHolder type and that field must be the - * first field in struct Config. - */ - typedef class Config ConfigKeyHolder; - - #define ConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ConfigPlugin_get_key PRESTypePluginDefaultEndpointData_getKey - #define ConfigPlugin_return_key PRESTypePluginDefaultEndpointData_returnKey - - #define ConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern Config* - ConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern Config* - ConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern Config* - ConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ConfigPluginSupport_copy_data( - Config *out, - const Config *in); - - NDDSUSERDllExport extern void - ConfigPluginSupport_destroy_data_w_params( - Config *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ConfigPluginSupport_destroy_data_ex( - Config *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ConfigPluginSupport_destroy_data( - Config *sample); - - NDDSUSERDllExport extern void - ConfigPluginSupport_print_data( - const Config *sample, - const char *desc, - unsigned int indent); - - NDDSUSERDllExport extern Config* - ConfigPluginSupport_create_key_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern Config* - ConfigPluginSupport_create_key(void); - - NDDSUSERDllExport extern void - ConfigPluginSupport_destroy_key_ex( - ConfigKeyHolder *key,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ConfigPluginSupport_destroy_key( - ConfigKeyHolder *key); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - ConfigPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - ConfigPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - ConfigPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - ConfigPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - ConfigPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - Config *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - Config *out, - const Config *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const Config *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - Config **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_deserialize_from_cdr_buffer( - Config *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - Config ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_instance_to_key( - PRESTypePluginEndpointData endpoint_data, - ConfigKeyHolder *key, - const Config *instance); - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_key_to_instance( - PRESTypePluginEndpointData endpoint_data, - Config *instance, - const ConfigKeyHolder *key); - - NDDSUSERDllExport extern RTIBool - ConfigPlugin_serialized_sample_to_keyhash( - PRESTypePluginEndpointData endpoint_data, - struct RTICdrStream *cdrStream, - DDS_KeyHash_t *keyhash, - RTIBool deserialize_encapsulation, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - ConfigPlugin_new(void); - - NDDSUSERDllExport extern void - ConfigPlugin_delete(struct PRESTypePlugin *); - - #define EventUnionPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define EventUnionPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define EventUnionPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define EventUnionPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define EventUnionPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern EventUnion* - EventUnionPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern EventUnion* - EventUnionPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern EventUnion* - EventUnionPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - EventUnionPluginSupport_copy_data( - EventUnion *out, - const EventUnion *in); - - NDDSUSERDllExport extern void - EventUnionPluginSupport_destroy_data_w_params( - EventUnion *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - EventUnionPluginSupport_destroy_data_ex( - EventUnion *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - EventUnionPluginSupport_destroy_data( - EventUnion *sample); - - NDDSUSERDllExport extern void - EventUnionPluginSupport_print_data( - const EventUnion *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EventUnionPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - EventUnion *out, - const EventUnion *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EventUnionPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const EventUnion *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - EventUnionPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - EventUnion **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - EventUnionPlugin_deserialize_from_cdr_buffer( - EventUnion *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - EventUnionPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - EventUnionPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - EventUnionPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - EventUnionPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - EventUnionPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - EventUnion ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* The type used to store keys for instances of type struct - * AnotherSimple. - * - * By default, this type is struct Event - * itself. However, if for some reason this choice is not practical for your - * system (e.g. if sizeof(struct Event) - * is very large), you may redefine this typedef in terms of another type of - * your choosing. HOWEVER, if you define the KeyHolder type to be something - * other than struct AnotherSimple, the - * following restriction applies: the key of struct - * Event must consist of a - * single field of your redefined KeyHolder type and that field must be the - * first field in struct Event. - */ - typedef class Event EventKeyHolder; - - #define EventPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define EventPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define EventPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define EventPlugin_get_key PRESTypePluginDefaultEndpointData_getKey - #define EventPlugin_return_key PRESTypePluginDefaultEndpointData_returnKey - - #define EventPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define EventPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern Event* - EventPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern Event* - EventPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern Event* - EventPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - EventPluginSupport_copy_data( - Event *out, - const Event *in); - - NDDSUSERDllExport extern void - EventPluginSupport_destroy_data_w_params( - Event *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - EventPluginSupport_destroy_data_ex( - Event *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - EventPluginSupport_destroy_data( - Event *sample); - - NDDSUSERDllExport extern void - EventPluginSupport_print_data( - const Event *sample, - const char *desc, - unsigned int indent); - - NDDSUSERDllExport extern Event* - EventPluginSupport_create_key_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern Event* - EventPluginSupport_create_key(void); - - NDDSUSERDllExport extern void - EventPluginSupport_destroy_key_ex( - EventKeyHolder *key,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - EventPluginSupport_destroy_key( - EventKeyHolder *key); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - EventPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - EventPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - EventPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - EventPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - EventPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - Event *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - EventPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - Event *out, - const Event *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EventPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const Event *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - EventPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - Event **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - EventPlugin_deserialize_from_cdr_buffer( - Event *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - EventPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - EventPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - EventPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - EventPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - EventPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - Event ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - EventPlugin_instance_to_key( - PRESTypePluginEndpointData endpoint_data, - EventKeyHolder *key, - const Event *instance); - - NDDSUSERDllExport extern RTIBool - EventPlugin_key_to_instance( - PRESTypePluginEndpointData endpoint_data, - Event *instance, - const EventKeyHolder *key); - - NDDSUSERDllExport extern RTIBool - EventPlugin_serialized_sample_to_keyhash( - PRESTypePluginEndpointData endpoint_data, - struct RTICdrStream *cdrStream, - DDS_KeyHash_t *keyhash, - RTIBool deserialize_encapsulation, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - EventPlugin_new(void); - - NDDSUSERDllExport extern void - EventPlugin_delete(struct PRESTypePlugin *); - - #define PeriodicUnionPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define PeriodicUnionPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define PeriodicUnionPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define PeriodicUnionPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define PeriodicUnionPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PeriodicUnion* - PeriodicUnionPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern PeriodicUnion* - PeriodicUnionPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern PeriodicUnion* - PeriodicUnionPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - PeriodicUnionPluginSupport_copy_data( - PeriodicUnion *out, - const PeriodicUnion *in); - - NDDSUSERDllExport extern void - PeriodicUnionPluginSupport_destroy_data_w_params( - PeriodicUnion *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - PeriodicUnionPluginSupport_destroy_data_ex( - PeriodicUnion *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - PeriodicUnionPluginSupport_destroy_data( - PeriodicUnion *sample); - - NDDSUSERDllExport extern void - PeriodicUnionPluginSupport_print_data( - const PeriodicUnion *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - PeriodicUnionPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - PeriodicUnion *out, - const PeriodicUnion *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - PeriodicUnionPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const PeriodicUnion *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - PeriodicUnionPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - PeriodicUnion **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - PeriodicUnionPlugin_deserialize_from_cdr_buffer( - PeriodicUnion *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - PeriodicUnionPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - PeriodicUnionPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - PeriodicUnionPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - PeriodicUnionPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - PeriodicUnionPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - PeriodicUnion ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* The type used to store keys for instances of type struct - * AnotherSimple. - * - * By default, this type is struct Periodic - * itself. However, if for some reason this choice is not practical for your - * system (e.g. if sizeof(struct Periodic) - * is very large), you may redefine this typedef in terms of another type of - * your choosing. HOWEVER, if you define the KeyHolder type to be something - * other than struct AnotherSimple, the - * following restriction applies: the key of struct - * Periodic must consist of a - * single field of your redefined KeyHolder type and that field must be the - * first field in struct Periodic. - */ - typedef class Periodic PeriodicKeyHolder; - - #define PeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define PeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define PeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define PeriodicPlugin_get_key PRESTypePluginDefaultEndpointData_getKey - #define PeriodicPlugin_return_key PRESTypePluginDefaultEndpointData_returnKey - - #define PeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define PeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern Periodic* - PeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern Periodic* - PeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern Periodic* - PeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - PeriodicPluginSupport_copy_data( - Periodic *out, - const Periodic *in); - - NDDSUSERDllExport extern void - PeriodicPluginSupport_destroy_data_w_params( - Periodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - PeriodicPluginSupport_destroy_data_ex( - Periodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - PeriodicPluginSupport_destroy_data( - Periodic *sample); - - NDDSUSERDllExport extern void - PeriodicPluginSupport_print_data( - const Periodic *sample, - const char *desc, - unsigned int indent); - - NDDSUSERDllExport extern Periodic* - PeriodicPluginSupport_create_key_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern Periodic* - PeriodicPluginSupport_create_key(void); - - NDDSUSERDllExport extern void - PeriodicPluginSupport_destroy_key_ex( - PeriodicKeyHolder *key,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - PeriodicPluginSupport_destroy_key( - PeriodicKeyHolder *key); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - PeriodicPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - PeriodicPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - PeriodicPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - PeriodicPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - PeriodicPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - Periodic *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - Periodic *out, - const Periodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const Periodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - Periodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_deserialize_from_cdr_buffer( - Periodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - PeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - PeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - PeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - PeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - Periodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_instance_to_key( - PRESTypePluginEndpointData endpoint_data, - PeriodicKeyHolder *key, - const Periodic *instance); - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_key_to_instance( - PRESTypePluginEndpointData endpoint_data, - Periodic *instance, - const PeriodicKeyHolder *key); - - NDDSUSERDllExport extern RTIBool - PeriodicPlugin_serialized_sample_to_keyhash( - PRESTypePluginEndpointData endpoint_data, - struct RTICdrStream *cdrStream, - DDS_KeyHash_t *keyhash, - RTIBool deserialize_encapsulation, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - PeriodicPlugin_new(void); - - NDDSUSERDllExport extern void - PeriodicPlugin_delete(struct PRESTypePlugin *); - - } /* namespace Monitoring */ - } /* namespace RecordingService */ -} /* namespace RTI */ - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_MONITORING) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif /* RecordingServiceMonitoringPlugin_741490407_h */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypes.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypes.hpp deleted file mode 100644 index c8b5d348f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypes.hpp +++ /dev/null @@ -1,925 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from RecordingServiceTypes.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef RecordingServiceTypes_164879555_hpp -#define RecordingServiceTypes_164879555_hpp - -#include - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_ADMINISTRATION) && defined(RTI_WIN32) -#undef RTIUSERDllExport -#define RTIUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport __attribute__((visibility("default"))) -#endif - -#include "dds/core/SafeEnumeration.hpp" -#include "dds/core/String.hpp" -#include "dds/core/array.hpp" -#include "dds/core/vector.hpp" -#include "dds/core/External.hpp" -#include "rti/core/LongDouble.hpp" -#include "rti/core/Pointer.hpp" -#include "rti/core/array.hpp" -#include "rti/topic/TopicTraits.hpp" - -#include "omg/types/string_view.hpp" - -#include "rti/core/BoundedSequence.hpp" -#include "dds/core/Optional.hpp" - -#ifndef NDDS_STANDALONE_TYPE -#include "cdr/cdr_typeCode.h" -#include "dds/domain/DomainParticipant.hpp" -#include "dds/topic/TopicTraits.hpp" -#include "dds/core/xtypes/DynamicType.hpp" -#include "dds/core/xtypes/StructType.hpp" -#include "dds/core/xtypes/UnionType.hpp" -#include "dds/core/xtypes/EnumType.hpp" -#include "dds/core/xtypes/AliasType.hpp" -#include "rti/util/StreamFlagSaver.hpp" -#include "rti/domain/PluginSupport.hpp" -#endif - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_ADMINISTRATION) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport -#endif - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_ADMINISTRATION) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -namespace RTI { - namespace RecordingService { - - static const int32_t DATA_TAG_MAX_STRING_SIZE = 256L; - - class NDDSUSERDllExport DataTagParams { - public: - - DataTagParams(); - - DataTagParams(float m_timestamp_offset__,const std::string& m_tag_name__,const std::string& m_tag_description__); - - float& timestamp_offset() noexcept { - return m_timestamp_offset_; - } - - const float& timestamp_offset() const noexcept { - return m_timestamp_offset_; - } - - void timestamp_offset(float value) { - - m_timestamp_offset_ = value; - } - - std::string& tag_name() noexcept { - return m_tag_name_; - } - - const std::string& tag_name() const noexcept { - return m_tag_name_; - } - - void tag_name(const std::string& value) { - - m_tag_name_ = value; - } - - void tag_name(std::string&& value) { - m_tag_name_ = std::move(value); - } - std::string& tag_description() noexcept { - return m_tag_description_; - } - - const std::string& tag_description() const noexcept { - return m_tag_description_; - } - - void tag_description(const std::string& value) { - - m_tag_description_ = value; - } - - void tag_description(std::string&& value) { - m_tag_description_ = std::move(value); - } - bool operator == (const DataTagParams& other_) const; - bool operator != (const DataTagParams& other_) const; - - void swap(DataTagParams& other_) noexcept ; - - private: - - float m_timestamp_offset_; - std::string m_tag_name_; - std::string m_tag_description_; - - }; - - inline void swap(DataTagParams& a, DataTagParams& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const DataTagParams& sample); - - enum class BreakpointFormat { - TIMESTAMP = 0, - TAG_NAME - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const BreakpointFormat& sample); - - class NDDSUSERDllExport BreakpointUnion { - public: - - BreakpointUnion(); - - ::RTI::RecordingService::BreakpointFormat& _d() { - return m_d_; - } - - const ::RTI::RecordingService::BreakpointFormat& _d() const { - return m_d_; - } - - void _d(::RTI::RecordingService::BreakpointFormat value) { - - m_d_ = value; - } - - int64_t& timestamp_nanos() { - - if (_d() != (RTI::RecordingService::BreakpointFormat::TIMESTAMP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::BreakpointUnion::timestamp_nanos not selected by the discriminator" ); - } - return m_u_.m_timestamp_nanos_; - } - - const int64_t& timestamp_nanos() const { - - if (_d() != (RTI::RecordingService::BreakpointFormat::TIMESTAMP) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::BreakpointUnion::timestamp_nanos not selected by the discriminator" ); - } - return m_u_.m_timestamp_nanos_; - } - - void timestamp_nanos(int64_t value) { - m_u_.m_timestamp_nanos_ = value; - m_d_= (RTI::RecordingService::BreakpointFormat::TIMESTAMP); - } - - std::string& tag_name() { - - if (_d() != (RTI::RecordingService::BreakpointFormat::TAG_NAME) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::BreakpointUnion::tag_name not selected by the discriminator" ); - } - return m_u_.m_tag_name_; - } - - const std::string& tag_name() const { - - if (_d() != (RTI::RecordingService::BreakpointFormat::TAG_NAME) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::BreakpointUnion::tag_name not selected by the discriminator" ); - } - return m_u_.m_tag_name_; - } - - void tag_name(const std::string& value) { - m_u_.m_tag_name_ = value; - m_d_= (RTI::RecordingService::BreakpointFormat::TAG_NAME); - } - - void tag_name(std::string&& value) { - m_u_.m_tag_name_ = std::move(value); - m_d_= (RTI::RecordingService::BreakpointFormat::TAG_NAME); - } - bool operator == (const BreakpointUnion& other_) const; - bool operator != (const BreakpointUnion& other_) const; - static ::RTI::RecordingService::BreakpointFormat default_discriminator(); - - void swap(BreakpointUnion& other_) noexcept ; - - private: - - ::RTI::RecordingService::BreakpointFormat m_d_; - struct NDDSUSERDllExport Union_ { - int64_t m_timestamp_nanos_; - std::string m_tag_name_; - Union_(); - Union_(int64_t m_timestamp_nanos__,const std::string& m_tag_name__); - }; - Union_ m_u_; - - }; - - inline void swap(BreakpointUnion& a, BreakpointUnion& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const BreakpointUnion& sample); - - class NDDSUSERDllExport BreakpointParams { - public: - - BreakpointParams(); - - BreakpointParams(const ::dds::core::optional< std::string >& m_label__,const ::RTI::RecordingService::BreakpointUnion& m_value__); - - ::dds::core::optional< std::string >& label() noexcept { - return m_label_; - } - - const ::dds::core::optional< std::string >& label() const noexcept { - return m_label_; - } - - void label(const ::dds::core::optional< std::string >& value) { - - m_label_ = value; - } - - void label(::dds::core::optional< std::string >&& value) { - m_label_ = std::move(value); - } - ::RTI::RecordingService::BreakpointUnion& value() noexcept { - return m_value_; - } - - const ::RTI::RecordingService::BreakpointUnion& value() const noexcept { - return m_value_; - } - - void value(const ::RTI::RecordingService::BreakpointUnion& value) { - - m_value_ = value; - } - - void value(::RTI::RecordingService::BreakpointUnion&& value) { - m_value_ = std::move(value); - } - bool operator == (const BreakpointParams& other_) const; - bool operator != (const BreakpointParams& other_) const; - - void swap(BreakpointParams& other_) noexcept ; - - private: - - ::dds::core::optional< std::string > m_label_; - ::RTI::RecordingService::BreakpointUnion m_value_; - - }; - - inline void swap(BreakpointParams& a, BreakpointParams& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const BreakpointParams& sample); - - enum class ContinueFormat { - OFFSET = 0, - SLICE - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const ContinueFormat& sample); - - class NDDSUSERDllExport ContinueUnion { - public: - - ContinueUnion(); - - ::RTI::RecordingService::ContinueFormat& _d() { - return m_d_; - } - - const ::RTI::RecordingService::ContinueFormat& _d() const { - return m_d_; - } - - void _d(::RTI::RecordingService::ContinueFormat value) { - - m_d_ = value; - } - - int64_t& offset() { - - if (_d() != (RTI::RecordingService::ContinueFormat::OFFSET) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::ContinueUnion::offset not selected by the discriminator" ); - } - return m_u_.m_offset_; - } - - const int64_t& offset() const { - - if (_d() != (RTI::RecordingService::ContinueFormat::OFFSET) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::ContinueUnion::offset not selected by the discriminator" ); - } - return m_u_.m_offset_; - } - - void offset(int64_t value) { - m_u_.m_offset_ = value; - m_d_= (RTI::RecordingService::ContinueFormat::OFFSET); - } - - int64_t& slices() { - - if (_d() != (RTI::RecordingService::ContinueFormat::SLICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::ContinueUnion::slices not selected by the discriminator" ); - } - return m_u_.m_slices_; - } - - const int64_t& slices() const { - - if (_d() != (RTI::RecordingService::ContinueFormat::SLICE) ) { - - throw ::dds::core::PreconditionNotMetError( - "::RTI::RecordingService::ContinueUnion::slices not selected by the discriminator" ); - } - return m_u_.m_slices_; - } - - void slices(int64_t value) { - m_u_.m_slices_ = value; - m_d_= (RTI::RecordingService::ContinueFormat::SLICE); - } - - bool operator == (const ContinueUnion& other_) const; - bool operator != (const ContinueUnion& other_) const; - static ::RTI::RecordingService::ContinueFormat default_discriminator(); - - void swap(ContinueUnion& other_) noexcept ; - - private: - - ::RTI::RecordingService::ContinueFormat m_d_; - struct NDDSUSERDllExport Union_ { - int64_t m_offset_; - int64_t m_slices_; - Union_(); - Union_(int64_t m_offset__,int64_t m_slices__); - }; - Union_ m_u_; - - }; - - inline void swap(ContinueUnion& a, ContinueUnion& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ContinueUnion& sample); - - class NDDSUSERDllExport ContinueParams { - public: - - ContinueParams(); - - explicit ContinueParams(const ::RTI::RecordingService::ContinueUnion& m_value__); - - ::RTI::RecordingService::ContinueUnion& value() noexcept { - return m_value_; - } - - const ::RTI::RecordingService::ContinueUnion& value() const noexcept { - return m_value_; - } - - void value(const ::RTI::RecordingService::ContinueUnion& value) { - - m_value_ = value; - } - - void value(::RTI::RecordingService::ContinueUnion&& value) { - m_value_ = std::move(value); - } - bool operator == (const ContinueParams& other_) const; - bool operator != (const ContinueParams& other_) const; - - void swap(ContinueParams& other_) noexcept ; - - private: - - ::RTI::RecordingService::ContinueUnion m_value_; - - }; - - inline void swap(ContinueParams& a, ContinueParams& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ContinueParams& sample); - - enum class TimerState { - WORKING = 0, - PAUSED, - BREAKPOINT - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const TimerState& sample); - - class NDDSUSERDllExport DebugStatus { - public: - - DebugStatus(); - - explicit DebugStatus(const ::RTI::RecordingService::TimerState& m_status__); - - ::RTI::RecordingService::TimerState& status() noexcept { - return m_status_; - } - - const ::RTI::RecordingService::TimerState& status() const noexcept { - return m_status_; - } - - void status(const ::RTI::RecordingService::TimerState& value) { - - m_status_ = value; - } - - void status(::RTI::RecordingService::TimerState&& value) { - m_status_ = std::move(value); - } - bool operator == (const DebugStatus& other_) const; - bool operator != (const DebugStatus& other_) const; - - void swap(DebugStatus& other_) noexcept ; - - private: - - ::RTI::RecordingService::TimerState m_status_; - - }; - - inline void swap(DebugStatus& a, DebugStatus& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const DebugStatus& sample); - - class NDDSUSERDllExport TimestampHolder { - public: - - TimestampHolder(); - - explicit TimestampHolder(int64_t m_timestamp_nanos__); - - int64_t& timestamp_nanos() noexcept { - return m_timestamp_nanos_; - } - - const int64_t& timestamp_nanos() const noexcept { - return m_timestamp_nanos_; - } - - void timestamp_nanos(int64_t value) { - - m_timestamp_nanos_ = value; - } - - bool operator == (const TimestampHolder& other_) const; - bool operator != (const TimestampHolder& other_) const; - - void swap(TimestampHolder& other_) noexcept ; - - private: - - int64_t m_timestamp_nanos_; - - }; - - inline void swap(TimestampHolder& a, TimestampHolder& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const TimestampHolder& sample); - - } // namespace RecordingService -} // namespace RTI - -#ifdef NDDS_STANDALONE_TYPE -namespace rti { - namespace topic { - template <> - struct default_enumerator< ::RTI::RecordingService::BreakpointFormat> - { - static const ::RTI::RecordingService::BreakpointFormat value; - }; - template <> - struct default_enumerator< ::RTI::RecordingService::ContinueFormat> - { - static const ::RTI::RecordingService::ContinueFormat value; - }; - template <> - struct default_enumerator< ::RTI::RecordingService::TimerState> - { - static const ::RTI::RecordingService::TimerState value; - }; - } -} -#else - -namespace rti { - namespace flat { - namespace topic { - } - } -} -namespace dds { - namespace topic { - - template<> - struct topic_type_name< ::RTI::RecordingService::DataTagParams > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::DataTagParams"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::DataTagParams > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::DataTagParams > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::DataTagParams& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::DataTagParams& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::DataTagParams& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::DataTagParams& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::BreakpointUnion > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::BreakpointUnion"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::BreakpointUnion > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::BreakpointUnion& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::BreakpointUnion& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::BreakpointParams > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::BreakpointParams"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::BreakpointParams > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::BreakpointParams > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::BreakpointParams& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::BreakpointParams& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::BreakpointParams& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::BreakpointParams& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::ContinueUnion > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::ContinueUnion"; - } - }; - - template<> - struct topic_type_support< ::RTI::RecordingService::ContinueUnion > { - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::ContinueUnion& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::ContinueUnion& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::ContinueParams > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::ContinueParams"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::ContinueParams > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::ContinueParams > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::ContinueParams& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::ContinueParams& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::ContinueParams& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::ContinueParams& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::DebugStatus > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::DebugStatus"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::DebugStatus > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::DebugStatus > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::DebugStatus& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::DebugStatus& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::DebugStatus& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::DebugStatus& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::RecordingService::TimestampHolder > { - NDDSUSERDllExport static std::string value() { - return "RTI::RecordingService::TimestampHolder"; - } - }; - - template<> - struct is_topic_type< ::RTI::RecordingService::TimestampHolder > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::RecordingService::TimestampHolder > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::RecordingService::TimestampHolder& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::RecordingService::TimestampHolder& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::RecordingService::TimestampHolder& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::RecordingService::TimestampHolder& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - } -} - -namespace rti { - namespace topic { - - template<> - struct dynamic_type< ::RTI::RecordingService::DataTagParams > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::DataTagParams > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template <> - struct default_enumerator< ::RTI::RecordingService::BreakpointFormat> - { - static const ::RTI::RecordingService::BreakpointFormat value; - }; - template<> - struct dynamic_type< ::RTI::RecordingService::BreakpointFormat > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::BreakpointFormat > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::BreakpointUnion > { - typedef ::dds::core::xtypes::UnionType type; - NDDSUSERDllExport static const ::dds::core::xtypes::UnionType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::BreakpointUnion > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::BreakpointParams > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::BreakpointParams > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template <> - struct default_enumerator< ::RTI::RecordingService::ContinueFormat> - { - static const ::RTI::RecordingService::ContinueFormat value; - }; - template<> - struct dynamic_type< ::RTI::RecordingService::ContinueFormat > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::ContinueFormat > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::ContinueUnion > { - typedef ::dds::core::xtypes::UnionType type; - NDDSUSERDllExport static const ::dds::core::xtypes::UnionType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::ContinueUnion > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::ContinueParams > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::ContinueParams > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template <> - struct default_enumerator< ::RTI::RecordingService::TimerState> - { - static const ::RTI::RecordingService::TimerState value; - }; - template<> - struct dynamic_type< ::RTI::RecordingService::TimerState > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::TimerState > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::DebugStatus > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::DebugStatus > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::RecordingService::TimestampHolder > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::RecordingService::TimestampHolder > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - } -} - -#endif // NDDS_STANDALONE_TYPE -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_ADMINISTRATION) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif // RecordingServiceTypes_164879555_hpp diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypesPlugin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypesPlugin.hpp deleted file mode 100644 index d895bf428..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/RecordingServiceTypesPlugin.hpp +++ /dev/null @@ -1,1179 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from RecordingServiceTypes.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef RecordingServiceTypesPlugin_164879555_h -#define RecordingServiceTypesPlugin_164879555_h - -#include "RecordingServiceTypes.hpp" - -struct RTICdrStream; - -#ifndef pres_typePlugin_h -#include "pres/pres_typePlugin.h" -#endif - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_ADMINISTRATION) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -namespace RTI { - namespace RecordingService { - - #define DataTagParamsPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define DataTagParamsPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define DataTagParamsPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define DataTagParamsPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define DataTagParamsPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern DataTagParams* - DataTagParamsPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern DataTagParams* - DataTagParamsPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern DataTagParams* - DataTagParamsPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - DataTagParamsPluginSupport_copy_data( - DataTagParams *out, - const DataTagParams *in); - - NDDSUSERDllExport extern void - DataTagParamsPluginSupport_destroy_data_w_params( - DataTagParams *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - DataTagParamsPluginSupport_destroy_data_ex( - DataTagParams *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - DataTagParamsPluginSupport_destroy_data( - DataTagParams *sample); - - NDDSUSERDllExport extern void - DataTagParamsPluginSupport_print_data( - const DataTagParams *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - DataTagParamsPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - DataTagParamsPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - DataTagParamsPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - DataTagParamsPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - DataTagParamsPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - DataTagParams *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - DataTagParamsPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - DataTagParams *out, - const DataTagParams *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - DataTagParamsPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const DataTagParams *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - DataTagParamsPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - DataTagParams **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - DataTagParamsPlugin_deserialize_from_cdr_buffer( - DataTagParams *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - DataTagParamsPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - DataTagParamsPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - DataTagParamsPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - DataTagParamsPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - DataTagParamsPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - DataTagParams ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - DataTagParamsPlugin_new(void); - - NDDSUSERDllExport extern void - DataTagParamsPlugin_delete(struct PRESTypePlugin *); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - BreakpointFormatPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - BreakpointFormatPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - BreakpointFormatPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - BreakpointFormatPluginSupport_print_data( - const BreakpointFormat *sample, - const char *desc, - unsigned int indent_level); - - #define BreakpointUnionPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define BreakpointUnionPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define BreakpointUnionPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define BreakpointUnionPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define BreakpointUnionPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern BreakpointUnion* - BreakpointUnionPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern BreakpointUnion* - BreakpointUnionPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern BreakpointUnion* - BreakpointUnionPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - BreakpointUnionPluginSupport_copy_data( - BreakpointUnion *out, - const BreakpointUnion *in); - - NDDSUSERDllExport extern void - BreakpointUnionPluginSupport_destroy_data_w_params( - BreakpointUnion *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - BreakpointUnionPluginSupport_destroy_data_ex( - BreakpointUnion *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - BreakpointUnionPluginSupport_destroy_data( - BreakpointUnion *sample); - - NDDSUSERDllExport extern void - BreakpointUnionPluginSupport_print_data( - const BreakpointUnion *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - BreakpointUnionPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - BreakpointUnion *out, - const BreakpointUnion *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - BreakpointUnionPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const BreakpointUnion *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - BreakpointUnionPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - BreakpointUnion **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - BreakpointUnionPlugin_deserialize_from_cdr_buffer( - BreakpointUnion *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - BreakpointUnionPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - BreakpointUnionPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - BreakpointUnionPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - BreakpointUnionPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - BreakpointUnionPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - BreakpointUnion ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define BreakpointParamsPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define BreakpointParamsPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define BreakpointParamsPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define BreakpointParamsPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define BreakpointParamsPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern BreakpointParams* - BreakpointParamsPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern BreakpointParams* - BreakpointParamsPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern BreakpointParams* - BreakpointParamsPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - BreakpointParamsPluginSupport_copy_data( - BreakpointParams *out, - const BreakpointParams *in); - - NDDSUSERDllExport extern void - BreakpointParamsPluginSupport_destroy_data_w_params( - BreakpointParams *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - BreakpointParamsPluginSupport_destroy_data_ex( - BreakpointParams *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - BreakpointParamsPluginSupport_destroy_data( - BreakpointParams *sample); - - NDDSUSERDllExport extern void - BreakpointParamsPluginSupport_print_data( - const BreakpointParams *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - BreakpointParamsPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - BreakpointParamsPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - BreakpointParamsPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - BreakpointParamsPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - BreakpointParamsPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - BreakpointParams *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - BreakpointParamsPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - BreakpointParams *out, - const BreakpointParams *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - BreakpointParamsPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const BreakpointParams *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - BreakpointParamsPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - BreakpointParams **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - BreakpointParamsPlugin_deserialize_from_cdr_buffer( - BreakpointParams *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - BreakpointParamsPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - BreakpointParamsPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - BreakpointParamsPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - BreakpointParamsPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - BreakpointParamsPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - BreakpointParams ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - BreakpointParamsPlugin_new(void); - - NDDSUSERDllExport extern void - BreakpointParamsPlugin_delete(struct PRESTypePlugin *); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ContinueFormatPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ContinueFormatPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ContinueFormatPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - ContinueFormatPluginSupport_print_data( - const ContinueFormat *sample, - const char *desc, - unsigned int indent_level); - - #define ContinueUnionPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ContinueUnionPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ContinueUnionPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ContinueUnionPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ContinueUnionPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ContinueUnion* - ContinueUnionPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ContinueUnion* - ContinueUnionPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ContinueUnion* - ContinueUnionPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ContinueUnionPluginSupport_copy_data( - ContinueUnion *out, - const ContinueUnion *in); - - NDDSUSERDllExport extern void - ContinueUnionPluginSupport_destroy_data_w_params( - ContinueUnion *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ContinueUnionPluginSupport_destroy_data_ex( - ContinueUnion *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ContinueUnionPluginSupport_destroy_data( - ContinueUnion *sample); - - NDDSUSERDllExport extern void - ContinueUnionPluginSupport_print_data( - const ContinueUnion *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ContinueUnionPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ContinueUnion *out, - const ContinueUnion *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ContinueUnionPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ContinueUnion *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ContinueUnionPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ContinueUnion **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ContinueUnionPlugin_deserialize_from_cdr_buffer( - ContinueUnion *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ContinueUnionPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ContinueUnionPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ContinueUnionPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ContinueUnionPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ContinueUnionPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ContinueUnion ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ContinueParamsPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ContinueParamsPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ContinueParamsPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ContinueParamsPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ContinueParamsPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ContinueParams* - ContinueParamsPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ContinueParams* - ContinueParamsPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ContinueParams* - ContinueParamsPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ContinueParamsPluginSupport_copy_data( - ContinueParams *out, - const ContinueParams *in); - - NDDSUSERDllExport extern void - ContinueParamsPluginSupport_destroy_data_w_params( - ContinueParams *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ContinueParamsPluginSupport_destroy_data_ex( - ContinueParams *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ContinueParamsPluginSupport_destroy_data( - ContinueParams *sample); - - NDDSUSERDllExport extern void - ContinueParamsPluginSupport_print_data( - const ContinueParams *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - ContinueParamsPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - ContinueParamsPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - ContinueParamsPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - ContinueParamsPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - ContinueParamsPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - ContinueParams *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - ContinueParamsPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ContinueParams *out, - const ContinueParams *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ContinueParamsPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ContinueParams *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ContinueParamsPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ContinueParams **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ContinueParamsPlugin_deserialize_from_cdr_buffer( - ContinueParams *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ContinueParamsPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ContinueParamsPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ContinueParamsPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ContinueParamsPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ContinueParamsPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ContinueParams ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - ContinueParamsPlugin_new(void); - - NDDSUSERDllExport extern void - ContinueParamsPlugin_delete(struct PRESTypePlugin *); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - TimerStatePlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - TimerStatePlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TimerStatePlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - TimerStatePluginSupport_print_data( - const TimerState *sample, - const char *desc, - unsigned int indent_level); - - #define DebugStatusPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define DebugStatusPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define DebugStatusPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define DebugStatusPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define DebugStatusPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern DebugStatus* - DebugStatusPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern DebugStatus* - DebugStatusPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern DebugStatus* - DebugStatusPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - DebugStatusPluginSupport_copy_data( - DebugStatus *out, - const DebugStatus *in); - - NDDSUSERDllExport extern void - DebugStatusPluginSupport_destroy_data_w_params( - DebugStatus *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - DebugStatusPluginSupport_destroy_data_ex( - DebugStatus *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - DebugStatusPluginSupport_destroy_data( - DebugStatus *sample); - - NDDSUSERDllExport extern void - DebugStatusPluginSupport_print_data( - const DebugStatus *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - DebugStatusPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - DebugStatusPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - DebugStatusPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - DebugStatusPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - DebugStatusPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - DebugStatus *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - DebugStatusPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - DebugStatus *out, - const DebugStatus *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - DebugStatusPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const DebugStatus *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - DebugStatusPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - DebugStatus **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - DebugStatusPlugin_deserialize_from_cdr_buffer( - DebugStatus *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - DebugStatusPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - DebugStatusPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - DebugStatusPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - DebugStatusPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - DebugStatusPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - DebugStatus ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - DebugStatusPlugin_new(void); - - NDDSUSERDllExport extern void - DebugStatusPlugin_delete(struct PRESTypePlugin *); - - #define TimestampHolderPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define TimestampHolderPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define TimestampHolderPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define TimestampHolderPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define TimestampHolderPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern TimestampHolder* - TimestampHolderPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern TimestampHolder* - TimestampHolderPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern TimestampHolder* - TimestampHolderPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - TimestampHolderPluginSupport_copy_data( - TimestampHolder *out, - const TimestampHolder *in); - - NDDSUSERDllExport extern void - TimestampHolderPluginSupport_destroy_data_w_params( - TimestampHolder *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - TimestampHolderPluginSupport_destroy_data_ex( - TimestampHolder *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - TimestampHolderPluginSupport_destroy_data( - TimestampHolder *sample); - - NDDSUSERDllExport extern void - TimestampHolderPluginSupport_print_data( - const TimestampHolder *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - TimestampHolderPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - TimestampHolderPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - TimestampHolderPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - TimestampHolderPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - TimestampHolderPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - TimestampHolder *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - TimestampHolderPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - TimestampHolder *out, - const TimestampHolder *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - TimestampHolderPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const TimestampHolder *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - TimestampHolderPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - TimestampHolder **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - TimestampHolderPlugin_deserialize_from_cdr_buffer( - TimestampHolder *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - TimestampHolderPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - TimestampHolderPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - TimestampHolderPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - TimestampHolderPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - TimestampHolderPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - TimestampHolder ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - TimestampHolderPlugin_new(void); - - NDDSUSERDllExport extern void - TimestampHolderPlugin_delete(struct PRESTypePlugin *); - - } /* namespace RecordingService */ -} /* namespace RTI */ - -#if defined(NDDS_USER_DLL_EXPORT_RECORDER_SERVICE_ADMINISTRATION) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif /* RecordingServiceTypesPlugin_164879555_h */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdmin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdmin.hpp deleted file mode 100644 index 81697e1f7..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdmin.hpp +++ /dev/null @@ -1,534 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from ServiceAdmin.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef ServiceAdmin_1325755560_hpp -#define ServiceAdmin_1325755560_hpp - -#include - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) && defined(RTI_WIN32) -#undef RTIUSERDllExport -#define RTIUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport __attribute__((visibility("default"))) -#endif - -#include "dds/core/SafeEnumeration.hpp" -#include "dds/core/String.hpp" -#include "dds/core/array.hpp" -#include "dds/core/vector.hpp" -#include "dds/core/External.hpp" -#include "rti/core/LongDouble.hpp" -#include "rti/core/Pointer.hpp" -#include "rti/core/array.hpp" -#include "rti/topic/TopicTraits.hpp" - -#include "omg/types/string_view.hpp" - -#include "rti/core/BoundedSequence.hpp" -#include "dds/core/Optional.hpp" - -#ifndef NDDS_STANDALONE_TYPE -#include "cdr/cdr_typeCode.h" -#include "dds/domain/DomainParticipant.hpp" -#include "dds/topic/TopicTraits.hpp" -#include "dds/core/xtypes/DynamicType.hpp" -#include "dds/core/xtypes/StructType.hpp" -#include "dds/core/xtypes/UnionType.hpp" -#include "dds/core/xtypes/EnumType.hpp" -#include "dds/core/xtypes/AliasType.hpp" -#include "rti/util/StreamFlagSaver.hpp" -#include "rti/domain/PluginSupport.hpp" -#endif - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport -#endif - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif -#include "ServiceCommon.hpp" -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif -namespace RTI { - namespace Service { - namespace Admin { - - static const std::string COMMAND_REQUEST_TOPIC_NAME = "rti/service/admin/command_request"; - - static const std::string COMMAND_REPLY_TOPIC_NAME = "rti/service/admin/command_reply"; - - static const int32_t NAME_LENGTH_MAX = (RTI::Service::BOUNDED_STRING_LENGTH_MAX); - - typedef std::string EntityName; - struct EntityName_AliasTag_t {}; - - static const int32_t RESOURCE_IDENTIFIER_LENGTH_MAX = (RTI::Service::RESOURCE_IDENTIFIER_LENGTH_MAX); - - typedef std::string ResourceIdentifier; - struct ResourceIdentifier_AliasTag_t {}; - - typedef std::string StringBody; - struct StringBody_AliasTag_t {}; - - #if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) - // On Windows, dll-export template instantiations of standard types used by - // other dll-exported types - template class NDDSUSERDllExport std::allocator< uint8_t >; - template class NDDSUSERDllExport std::vector< uint8_t >; - #endif - typedef std::vector< uint8_t > OctetBody; - struct OctetBody_AliasTag_t {}; - enum class CommandActionKind { - CREATE_ACTION, - GET_ACTION, - UPDATE_ACTION, - DELETE_ACTION - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const CommandActionKind& sample); - enum class CommandReplyRetcode { - OK_RETCODE, - ERROR_RETCODE - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const CommandReplyRetcode& sample); - - class NDDSUSERDllExport CommandRequest { - public: - - CommandRequest(); - - CommandRequest(int32_t m_instance_id__,const ::dds::core::optional< std::string >& m_application_name__,const ::RTI::Service::Admin::CommandActionKind& m_action__,const std::string& m_resource_identifier__,const std::string& m_string_body__,const ::RTI::Service::Admin::OctetBody& m_octet_body__); - - int32_t& instance_id() noexcept { - return m_instance_id_; - } - - const int32_t& instance_id() const noexcept { - return m_instance_id_; - } - - void instance_id(int32_t value) { - - m_instance_id_ = value; - } - - ::dds::core::optional< std::string >& application_name() noexcept { - return m_application_name_; - } - - const ::dds::core::optional< std::string >& application_name() const noexcept { - return m_application_name_; - } - - void application_name(const ::dds::core::optional< std::string >& value) { - - m_application_name_ = value; - } - - void application_name(::dds::core::optional< std::string >&& value) { - m_application_name_ = std::move(value); - } - ::RTI::Service::Admin::CommandActionKind& action() noexcept { - return m_action_; - } - - const ::RTI::Service::Admin::CommandActionKind& action() const noexcept { - return m_action_; - } - - void action(const ::RTI::Service::Admin::CommandActionKind& value) { - - m_action_ = value; - } - - void action(::RTI::Service::Admin::CommandActionKind&& value) { - m_action_ = std::move(value); - } - std::string& resource_identifier() noexcept { - return m_resource_identifier_; - } - - const std::string& resource_identifier() const noexcept { - return m_resource_identifier_; - } - - void resource_identifier(const std::string& value) { - - m_resource_identifier_ = value; - } - - void resource_identifier(std::string&& value) { - m_resource_identifier_ = std::move(value); - } - std::string& string_body() noexcept { - return m_string_body_; - } - - const std::string& string_body() const noexcept { - return m_string_body_; - } - - void string_body(const std::string& value) { - - m_string_body_ = value; - } - - void string_body(std::string&& value) { - m_string_body_ = std::move(value); - } - ::RTI::Service::Admin::OctetBody& octet_body() noexcept { - return m_octet_body_; - } - - const ::RTI::Service::Admin::OctetBody& octet_body() const noexcept { - return m_octet_body_; - } - - void octet_body(const ::RTI::Service::Admin::OctetBody& value) { - - m_octet_body_ = value; - } - - void octet_body(::RTI::Service::Admin::OctetBody&& value) { - m_octet_body_ = std::move(value); - } - bool operator == (const CommandRequest& other_) const; - bool operator != (const CommandRequest& other_) const; - - void swap(CommandRequest& other_) noexcept ; - - private: - - int32_t m_instance_id_; - ::dds::core::optional< std::string > m_application_name_; - ::RTI::Service::Admin::CommandActionKind m_action_; - std::string m_resource_identifier_; - std::string m_string_body_; - ::RTI::Service::Admin::OctetBody m_octet_body_; - - }; - - inline void swap(CommandRequest& a, CommandRequest& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const CommandRequest& sample); - - class NDDSUSERDllExport CommandReply { - public: - - CommandReply(); - - CommandReply(const ::RTI::Service::Admin::CommandReplyRetcode& m_retcode__,int32_t m_native_retcode__,const std::string& m_string_body__,const ::RTI::Service::Admin::OctetBody& m_octet_body__); - - ::RTI::Service::Admin::CommandReplyRetcode& retcode() noexcept { - return m_retcode_; - } - - const ::RTI::Service::Admin::CommandReplyRetcode& retcode() const noexcept { - return m_retcode_; - } - - void retcode(const ::RTI::Service::Admin::CommandReplyRetcode& value) { - - m_retcode_ = value; - } - - void retcode(::RTI::Service::Admin::CommandReplyRetcode&& value) { - m_retcode_ = std::move(value); - } - int32_t& native_retcode() noexcept { - return m_native_retcode_; - } - - const int32_t& native_retcode() const noexcept { - return m_native_retcode_; - } - - void native_retcode(int32_t value) { - - m_native_retcode_ = value; - } - - std::string& string_body() noexcept { - return m_string_body_; - } - - const std::string& string_body() const noexcept { - return m_string_body_; - } - - void string_body(const std::string& value) { - - m_string_body_ = value; - } - - void string_body(std::string&& value) { - m_string_body_ = std::move(value); - } - ::RTI::Service::Admin::OctetBody& octet_body() noexcept { - return m_octet_body_; - } - - const ::RTI::Service::Admin::OctetBody& octet_body() const noexcept { - return m_octet_body_; - } - - void octet_body(const ::RTI::Service::Admin::OctetBody& value) { - - m_octet_body_ = value; - } - - void octet_body(::RTI::Service::Admin::OctetBody&& value) { - m_octet_body_ = std::move(value); - } - bool operator == (const CommandReply& other_) const; - bool operator != (const CommandReply& other_) const; - - void swap(CommandReply& other_) noexcept ; - - private: - - ::RTI::Service::Admin::CommandReplyRetcode m_retcode_; - int32_t m_native_retcode_; - std::string m_string_body_; - ::RTI::Service::Admin::OctetBody m_octet_body_; - - }; - - inline void swap(CommandReply& a, CommandReply& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const CommandReply& sample); - - } // namespace Admin - } // namespace Service -} // namespace RTI - -#ifdef NDDS_STANDALONE_TYPE -namespace rti { - namespace topic { - template <> - struct default_enumerator< ::RTI::Service::Admin::CommandActionKind> - { - static const ::RTI::Service::Admin::CommandActionKind value; - }; - template <> - struct default_enumerator< ::RTI::Service::Admin::CommandReplyRetcode> - { - static const ::RTI::Service::Admin::CommandReplyRetcode value; - }; - } -} -#else - -namespace rti { - namespace flat { - namespace topic { - } - } -} -namespace dds { - namespace topic { - - template<> - struct topic_type_name< ::RTI::Service::Admin::CommandRequest > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Admin::CommandRequest"; - } - }; - - template<> - struct is_topic_type< ::RTI::Service::Admin::CommandRequest > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::Service::Admin::CommandRequest > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::Service::Admin::CommandRequest& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::Service::Admin::CommandRequest& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Admin::CommandRequest& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Admin::CommandRequest& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Admin::CommandReply > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Admin::CommandReply"; - } - }; - - template<> - struct is_topic_type< ::RTI::Service::Admin::CommandReply > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::Service::Admin::CommandReply > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::Service::Admin::CommandReply& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::Service::Admin::CommandReply& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Admin::CommandReply& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Admin::CommandReply& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - } -} - -namespace rti { - namespace topic { - - template<> - struct dynamic_type< ::RTI::Service::Admin::EntityName_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template<> - struct dynamic_type< ::RTI::Service::Admin::ResourceIdentifier_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template<> - struct dynamic_type< ::RTI::Service::Admin::StringBody_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template<> - struct dynamic_type< ::RTI::Service::Admin::OctetBody_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template <> - struct default_enumerator< ::RTI::Service::Admin::CommandActionKind> - { - static const ::RTI::Service::Admin::CommandActionKind value; - }; - template<> - struct dynamic_type< ::RTI::Service::Admin::CommandActionKind > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Admin::CommandActionKind > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template <> - struct default_enumerator< ::RTI::Service::Admin::CommandReplyRetcode> - { - static const ::RTI::Service::Admin::CommandReplyRetcode value; - }; - template<> - struct dynamic_type< ::RTI::Service::Admin::CommandReplyRetcode > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Admin::CommandReplyRetcode > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Admin::CommandRequest > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Admin::CommandRequest > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Admin::CommandReply > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Admin::CommandReply > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - } -} - -#endif // NDDS_STANDALONE_TYPE -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif // ServiceAdmin_1325755560_hpp diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdminPlugin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdminPlugin.hpp deleted file mode 100644 index 6eec7a9e5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceAdminPlugin.hpp +++ /dev/null @@ -1,834 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from ServiceAdmin.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef ServiceAdminPlugin_1325755560_h -#define ServiceAdminPlugin_1325755560_h - -#include "ServiceAdmin.hpp" - -struct RTICdrStream; - -#ifndef pres_typePlugin_h -#include "pres/pres_typePlugin.h" -#endif - -#include "ServiceCommonPlugin.hpp" - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -namespace RTI { - namespace Service { - namespace Admin { - - #define EntityNamePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define EntityNamePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define EntityNamePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define EntityNamePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define EntityNamePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern EntityName* - EntityNamePluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern EntityName* - EntityNamePluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern EntityName* - EntityNamePluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - EntityNamePluginSupport_copy_data( - EntityName *out, - const EntityName *in); - - NDDSUSERDllExport extern void - EntityNamePluginSupport_destroy_data_w_params( - EntityName *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - EntityNamePluginSupport_destroy_data_ex( - EntityName *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - EntityNamePluginSupport_destroy_data( - EntityName *sample); - - NDDSUSERDllExport extern void - EntityNamePluginSupport_print_data( - const EntityName *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EntityNamePlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - EntityName *out, - const EntityName *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - EntityNamePlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - EntityNamePlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - EntityNamePlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - EntityNamePlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - #define ResourceIdentifierPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ResourceIdentifierPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ResourceIdentifierPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ResourceIdentifierPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ResourceIdentifierPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ResourceIdentifier* - ResourceIdentifierPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ResourceIdentifier* - ResourceIdentifierPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ResourceIdentifier* - ResourceIdentifierPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ResourceIdentifierPluginSupport_copy_data( - ResourceIdentifier *out, - const ResourceIdentifier *in); - - NDDSUSERDllExport extern void - ResourceIdentifierPluginSupport_destroy_data_w_params( - ResourceIdentifier *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ResourceIdentifierPluginSupport_destroy_data_ex( - ResourceIdentifier *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ResourceIdentifierPluginSupport_destroy_data( - ResourceIdentifier *sample); - - NDDSUSERDllExport extern void - ResourceIdentifierPluginSupport_print_data( - const ResourceIdentifier *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ResourceIdentifierPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ResourceIdentifier *out, - const ResourceIdentifier *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ResourceIdentifierPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ResourceIdentifierPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ResourceIdentifierPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ResourceIdentifierPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - #define StringBodyPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define StringBodyPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define StringBodyPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define StringBodyPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define StringBodyPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern StringBody* - StringBodyPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern StringBody* - StringBodyPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern StringBody* - StringBodyPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - StringBodyPluginSupport_copy_data( - StringBody *out, - const StringBody *in); - - NDDSUSERDllExport extern void - StringBodyPluginSupport_destroy_data_w_params( - StringBody *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - StringBodyPluginSupport_destroy_data_ex( - StringBody *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - StringBodyPluginSupport_destroy_data( - StringBody *sample); - - NDDSUSERDllExport extern void - StringBodyPluginSupport_print_data( - const StringBody *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - StringBodyPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - StringBody *out, - const StringBody *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - StringBodyPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - StringBodyPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - StringBodyPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - StringBodyPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - #define OctetBodyPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define OctetBodyPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define OctetBodyPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define OctetBodyPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define OctetBodyPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern OctetBody* - OctetBodyPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern OctetBody* - OctetBodyPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern OctetBody* - OctetBodyPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - OctetBodyPluginSupport_copy_data( - OctetBody *out, - const OctetBody *in); - - NDDSUSERDllExport extern void - OctetBodyPluginSupport_destroy_data_w_params( - OctetBody *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - OctetBodyPluginSupport_destroy_data_ex( - OctetBody *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - OctetBodyPluginSupport_destroy_data( - OctetBody *sample); - - NDDSUSERDllExport extern void - OctetBodyPluginSupport_print_data( - const OctetBody *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - OctetBodyPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - OctetBody *out, - const OctetBody *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - OctetBodyPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - OctetBodyPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - OctetBodyPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - OctetBodyPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - CommandActionKindPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - CommandActionKindPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - CommandActionKindPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - CommandActionKindPluginSupport_print_data( - const CommandActionKind *sample, - const char *desc, - unsigned int indent_level); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - CommandReplyRetcodePlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - CommandReplyRetcodePlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - CommandReplyRetcodePlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - CommandReplyRetcodePluginSupport_print_data( - const CommandReplyRetcode *sample, - const char *desc, - unsigned int indent_level); - - /* The type used to store keys for instances of type struct - * AnotherSimple. - * - * By default, this type is struct CommandRequest - * itself. However, if for some reason this choice is not practical for your - * system (e.g. if sizeof(struct CommandRequest) - * is very large), you may redefine this typedef in terms of another type of - * your choosing. HOWEVER, if you define the KeyHolder type to be something - * other than struct AnotherSimple, the - * following restriction applies: the key of struct - * CommandRequest must consist of a - * single field of your redefined KeyHolder type and that field must be the - * first field in struct CommandRequest. - */ - typedef class CommandRequest CommandRequestKeyHolder; - - #define CommandRequestPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define CommandRequestPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define CommandRequestPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define CommandRequestPlugin_get_key PRESTypePluginDefaultEndpointData_getKey - #define CommandRequestPlugin_return_key PRESTypePluginDefaultEndpointData_returnKey - - #define CommandRequestPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define CommandRequestPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern CommandRequest* - CommandRequestPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern CommandRequest* - CommandRequestPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern CommandRequest* - CommandRequestPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - CommandRequestPluginSupport_copy_data( - CommandRequest *out, - const CommandRequest *in); - - NDDSUSERDllExport extern void - CommandRequestPluginSupport_destroy_data_w_params( - CommandRequest *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - CommandRequestPluginSupport_destroy_data_ex( - CommandRequest *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - CommandRequestPluginSupport_destroy_data( - CommandRequest *sample); - - NDDSUSERDllExport extern void - CommandRequestPluginSupport_print_data( - const CommandRequest *sample, - const char *desc, - unsigned int indent); - - NDDSUSERDllExport extern CommandRequest* - CommandRequestPluginSupport_create_key_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern CommandRequest* - CommandRequestPluginSupport_create_key(void); - - NDDSUSERDllExport extern void - CommandRequestPluginSupport_destroy_key_ex( - CommandRequestKeyHolder *key,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - CommandRequestPluginSupport_destroy_key( - CommandRequestKeyHolder *key); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - CommandRequestPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - CommandRequestPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - CommandRequestPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - CommandRequestPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - CommandRequestPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - CommandRequest *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - CommandRequest *out, - const CommandRequest *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const CommandRequest *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - CommandRequest **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_deserialize_from_cdr_buffer( - CommandRequest *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - CommandRequestPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - CommandRequestPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - CommandRequestPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - CommandRequestPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - CommandRequest ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_instance_to_key( - PRESTypePluginEndpointData endpoint_data, - CommandRequestKeyHolder *key, - const CommandRequest *instance); - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_key_to_instance( - PRESTypePluginEndpointData endpoint_data, - CommandRequest *instance, - const CommandRequestKeyHolder *key); - - NDDSUSERDllExport extern RTIBool - CommandRequestPlugin_serialized_sample_to_keyhash( - PRESTypePluginEndpointData endpoint_data, - struct RTICdrStream *cdrStream, - DDS_KeyHash_t *keyhash, - RTIBool deserialize_encapsulation, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - CommandRequestPlugin_new(void); - - NDDSUSERDllExport extern void - CommandRequestPlugin_delete(struct PRESTypePlugin *); - - #define CommandReplyPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define CommandReplyPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define CommandReplyPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define CommandReplyPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define CommandReplyPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern CommandReply* - CommandReplyPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern CommandReply* - CommandReplyPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern CommandReply* - CommandReplyPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - CommandReplyPluginSupport_copy_data( - CommandReply *out, - const CommandReply *in); - - NDDSUSERDllExport extern void - CommandReplyPluginSupport_destroy_data_w_params( - CommandReply *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - CommandReplyPluginSupport_destroy_data_ex( - CommandReply *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - CommandReplyPluginSupport_destroy_data( - CommandReply *sample); - - NDDSUSERDllExport extern void - CommandReplyPluginSupport_print_data( - const CommandReply *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - CommandReplyPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - CommandReplyPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - CommandReplyPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - CommandReplyPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - CommandReplyPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - CommandReply *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - CommandReplyPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - CommandReply *out, - const CommandReply *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - CommandReplyPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const CommandReply *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - CommandReplyPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - CommandReply **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - CommandReplyPlugin_deserialize_from_cdr_buffer( - CommandReply *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - CommandReplyPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - CommandReplyPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - CommandReplyPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - CommandReplyPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - CommandReplyPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - CommandReply ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - CommandReplyPlugin_new(void); - - NDDSUSERDllExport extern void - CommandReplyPlugin_delete(struct PRESTypePlugin *); - - } /* namespace Admin */ - } /* namespace Service */ -} /* namespace RTI */ - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_ADMIN) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif /* ServiceAdminPlugin_1325755560_h */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommon.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommon.hpp deleted file mode 100644 index c1f4693e4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommon.hpp +++ /dev/null @@ -1,1803 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from ServiceCommon.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef ServiceCommon_1902811798_hpp -#define ServiceCommon_1902811798_hpp - -#include - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_COMMON) && defined(RTI_WIN32) -#undef RTIUSERDllExport -#define RTIUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport __attribute__((visibility("default"))) -#endif - -#include "dds/core/SafeEnumeration.hpp" -#include "dds/core/String.hpp" -#include "dds/core/array.hpp" -#include "dds/core/vector.hpp" -#include "dds/core/External.hpp" -#include "rti/core/LongDouble.hpp" -#include "rti/core/Pointer.hpp" -#include "rti/core/array.hpp" -#include "rti/topic/TopicTraits.hpp" - -#include "omg/types/string_view.hpp" - -#include "rti/core/BoundedSequence.hpp" -#include "dds/core/Optional.hpp" - -#ifndef NDDS_STANDALONE_TYPE -#include "cdr/cdr_typeCode.h" -#include "dds/domain/DomainParticipant.hpp" -#include "dds/topic/TopicTraits.hpp" -#include "dds/core/xtypes/DynamicType.hpp" -#include "dds/core/xtypes/StructType.hpp" -#include "dds/core/xtypes/UnionType.hpp" -#include "dds/core/xtypes/EnumType.hpp" -#include "dds/core/xtypes/AliasType.hpp" -#include "rti/util/StreamFlagSaver.hpp" -#include "rti/domain/PluginSupport.hpp" -#endif - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_COMMON) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef RTIUSERDllExport -#define RTIUSERDllExport -#endif - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_COMMON) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -namespace RTI { - namespace Service { - - static const int32_t BOUNDED_STRING_LENGTH_MAX = 255L; - - typedef std::string BoundedString; - struct BoundedString_AliasTag_t {}; - - static const int32_t FILE_PATH_MAX_LENGTH = 1024L; - - typedef std::string FilePath; - struct FilePath_AliasTag_t {}; - - static const int32_t RESOURCE_IDENTIFIER_LENGTH_MAX = 2048L; - - typedef std::string ResourceId; - struct ResourceId_AliasTag_t {}; - - typedef std::string XmlString; - struct XmlString_AliasTag_t {}; - enum class EntityStateKind { - INVALID, - ENABLED, - DISABLED, - STARTED, - STOPPED, - RUNNING, - PAUSED - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const EntityStateKind& sample); - - class NDDSUSERDllExport EntityState { - public: - - EntityState(); - - explicit EntityState(const ::RTI::Service::EntityStateKind& m_state__); - - ::RTI::Service::EntityStateKind& state() noexcept { - return m_state_; - } - - const ::RTI::Service::EntityStateKind& state() const noexcept { - return m_state_; - } - - void state(const ::RTI::Service::EntityStateKind& value) { - - m_state_ = value; - } - - void state(::RTI::Service::EntityStateKind&& value) { - m_state_ = std::move(value); - } - bool operator == (const EntityState& other_) const; - bool operator != (const EntityState& other_) const; - - void swap(EntityState& other_) noexcept ; - - private: - - ::RTI::Service::EntityStateKind m_state_; - - }; - - inline void swap(EntityState& a, EntityState& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const EntityState& sample); - - static const int32_t BUILTIN_TOPIC_KEY_VALUE_LENGTH = 4L; - - class NDDSUSERDllExport BuiltinTopicKey { - public: - - BuiltinTopicKey(); - - explicit BuiltinTopicKey(const ::dds::core::array< uint32_t, (RTI::Service::BUILTIN_TOPIC_KEY_VALUE_LENGTH)>& m_value__); - - ::dds::core::array< uint32_t, (RTI::Service::BUILTIN_TOPIC_KEY_VALUE_LENGTH)>& value() noexcept { - return m_value_; - } - - const ::dds::core::array< uint32_t, (RTI::Service::BUILTIN_TOPIC_KEY_VALUE_LENGTH)>& value() const noexcept { - return m_value_; - } - - void value(const ::dds::core::array< uint32_t, (RTI::Service::BUILTIN_TOPIC_KEY_VALUE_LENGTH)>& value) { - - m_value_ = value; - } - - void value(::dds::core::array< uint32_t, (RTI::Service::BUILTIN_TOPIC_KEY_VALUE_LENGTH)>&& value) { - m_value_ = std::move(value); - } - bool operator == (const BuiltinTopicKey& other_) const; - bool operator != (const BuiltinTopicKey& other_) const; - - void swap(BuiltinTopicKey& other_) noexcept ; - - private: - - ::dds::core::array< uint32_t, (RTI::Service::BUILTIN_TOPIC_KEY_VALUE_LENGTH)> m_value_ {}; - - }; - - inline void swap(BuiltinTopicKey& a, BuiltinTopicKey& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const BuiltinTopicKey& sample); - - namespace Monitoring { - - static const int32_t RESOURCE_GUID_VALUE_LENGTH = 16L; - - class NDDSUSERDllExport ResourceGuid { - public: - - ResourceGuid(); - - explicit ResourceGuid(const ::dds::core::array< uint8_t, (RTI::Service::Monitoring::RESOURCE_GUID_VALUE_LENGTH)>& m_value__); - - ::dds::core::array< uint8_t, (RTI::Service::Monitoring::RESOURCE_GUID_VALUE_LENGTH)>& value() noexcept { - return m_value_; - } - - const ::dds::core::array< uint8_t, (RTI::Service::Monitoring::RESOURCE_GUID_VALUE_LENGTH)>& value() const noexcept { - return m_value_; - } - - void value(const ::dds::core::array< uint8_t, (RTI::Service::Monitoring::RESOURCE_GUID_VALUE_LENGTH)>& value) { - - m_value_ = value; - } - - void value(::dds::core::array< uint8_t, (RTI::Service::Monitoring::RESOURCE_GUID_VALUE_LENGTH)>&& value) { - m_value_ = std::move(value); - } - bool operator == (const ResourceGuid& other_) const; - bool operator != (const ResourceGuid& other_) const; - - void swap(ResourceGuid& other_) noexcept ; - - private: - - ::dds::core::array< uint8_t, (RTI::Service::Monitoring::RESOURCE_GUID_VALUE_LENGTH)> m_value_ {}; - - }; - - inline void swap(ResourceGuid& a, ResourceGuid& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ResourceGuid& sample); - - class NDDSUSERDllExport KeyedResource { - public: - - KeyedResource(); - - KeyedResource(const ::RTI::Service::Monitoring::ResourceGuid& m_object_guid__,const ::RTI::Service::Monitoring::ResourceGuid& m_owner_guid__); - - ::RTI::Service::Monitoring::ResourceGuid& object_guid() noexcept { - return m_object_guid_; - } - - const ::RTI::Service::Monitoring::ResourceGuid& object_guid() const noexcept { - return m_object_guid_; - } - - void object_guid(const ::RTI::Service::Monitoring::ResourceGuid& value) { - - m_object_guid_ = value; - } - - void object_guid(::RTI::Service::Monitoring::ResourceGuid&& value) { - m_object_guid_ = std::move(value); - } - ::RTI::Service::Monitoring::ResourceGuid& owner_guid() noexcept { - return m_owner_guid_; - } - - const ::RTI::Service::Monitoring::ResourceGuid& owner_guid() const noexcept { - return m_owner_guid_; - } - - void owner_guid(const ::RTI::Service::Monitoring::ResourceGuid& value) { - - m_owner_guid_ = value; - } - - void owner_guid(::RTI::Service::Monitoring::ResourceGuid&& value) { - m_owner_guid_ = std::move(value); - } - bool operator == (const KeyedResource& other_) const; - bool operator != (const KeyedResource& other_) const; - - void swap(KeyedResource& other_) noexcept ; - - private: - - ::RTI::Service::Monitoring::ResourceGuid m_object_guid_; - ::RTI::Service::Monitoring::ResourceGuid m_owner_guid_; - - }; - - inline void swap(KeyedResource& a, KeyedResource& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const KeyedResource& sample); - - class NDDSUSERDllExport StatisticMetrics { - public: - - StatisticMetrics(); - - StatisticMetrics(uint64_t m_period_ms__,int64_t m_count__,float m_mean__,float m_minimum__,float m_maximum__,float m_std_dev__); - - uint64_t& period_ms() noexcept { - return m_period_ms_; - } - - const uint64_t& period_ms() const noexcept { - return m_period_ms_; - } - - void period_ms(uint64_t value) { - - m_period_ms_ = value; - } - - int64_t& count() noexcept { - return m_count_; - } - - const int64_t& count() const noexcept { - return m_count_; - } - - void count(int64_t value) { - - m_count_ = value; - } - - float& mean() noexcept { - return m_mean_; - } - - const float& mean() const noexcept { - return m_mean_; - } - - void mean(float value) { - - m_mean_ = value; - } - - float& minimum() noexcept { - return m_minimum_; - } - - const float& minimum() const noexcept { - return m_minimum_; - } - - void minimum(float value) { - - m_minimum_ = value; - } - - float& maximum() noexcept { - return m_maximum_; - } - - const float& maximum() const noexcept { - return m_maximum_; - } - - void maximum(float value) { - - m_maximum_ = value; - } - - float& std_dev() noexcept { - return m_std_dev_; - } - - const float& std_dev() const noexcept { - return m_std_dev_; - } - - void std_dev(float value) { - - m_std_dev_ = value; - } - - bool operator == (const StatisticMetrics& other_) const; - bool operator != (const StatisticMetrics& other_) const; - - void swap(StatisticMetrics& other_) noexcept ; - - private: - - uint64_t m_period_ms_; - int64_t m_count_; - float m_mean_; - float m_minimum_; - float m_maximum_; - float m_std_dev_; - - }; - - inline void swap(StatisticMetrics& a, StatisticMetrics& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const StatisticMetrics& sample); - - class NDDSUSERDllExport StatisticVariable { - public: - - StatisticVariable(); - - explicit StatisticVariable(const ::RTI::Service::Monitoring::StatisticMetrics& m_publication_period_metrics__); - - ::RTI::Service::Monitoring::StatisticMetrics& publication_period_metrics() noexcept { - return m_publication_period_metrics_; - } - - const ::RTI::Service::Monitoring::StatisticMetrics& publication_period_metrics() const noexcept { - return m_publication_period_metrics_; - } - - void publication_period_metrics(const ::RTI::Service::Monitoring::StatisticMetrics& value) { - - m_publication_period_metrics_ = value; - } - - void publication_period_metrics(::RTI::Service::Monitoring::StatisticMetrics&& value) { - m_publication_period_metrics_ = std::move(value); - } - bool operator == (const StatisticVariable& other_) const; - bool operator != (const StatisticVariable& other_) const; - - void swap(StatisticVariable& other_) noexcept ; - - private: - - ::RTI::Service::Monitoring::StatisticMetrics m_publication_period_metrics_; - - }; - - inline void swap(StatisticVariable& a, StatisticVariable& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const StatisticVariable& sample); - - class NDDSUSERDllExport CountStatus { - public: - - CountStatus(); - - CountStatus(int64_t m_total_count__,int64_t m_current_count__,int64_t m_current_count_peak__); - - int64_t& total_count() noexcept { - return m_total_count_; - } - - const int64_t& total_count() const noexcept { - return m_total_count_; - } - - void total_count(int64_t value) { - - m_total_count_ = value; - } - - int64_t& current_count() noexcept { - return m_current_count_; - } - - const int64_t& current_count() const noexcept { - return m_current_count_; - } - - void current_count(int64_t value) { - - m_current_count_ = value; - } - - int64_t& current_count_peak() noexcept { - return m_current_count_peak_; - } - - const int64_t& current_count_peak() const noexcept { - return m_current_count_peak_; - } - - void current_count_peak(int64_t value) { - - m_current_count_peak_ = value; - } - - bool operator == (const CountStatus& other_) const; - bool operator != (const CountStatus& other_) const; - - void swap(CountStatus& other_) noexcept ; - - private: - - int64_t m_total_count_; - int64_t m_current_count_; - int64_t m_current_count_peak_; - - }; - - inline void swap(CountStatus& a, CountStatus& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const CountStatus& sample); - - class NDDSUSERDllExport ProcessConfig { - public: - - ProcessConfig(); - - explicit ProcessConfig(uint64_t m_id__); - - uint64_t& id() noexcept { - return m_id_; - } - - const uint64_t& id() const noexcept { - return m_id_; - } - - void id(uint64_t value) { - - m_id_ = value; - } - - bool operator == (const ProcessConfig& other_) const; - bool operator != (const ProcessConfig& other_) const; - - void swap(ProcessConfig& other_) noexcept ; - - private: - - uint64_t m_id_; - - }; - - inline void swap(ProcessConfig& a, ProcessConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ProcessConfig& sample); - - class NDDSUSERDllExport ProcessPeriodic { - public: - - ProcessPeriodic(); - - ProcessPeriodic(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_cpu_usage_percentage__,const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_physical_memory_kb__,const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_total_memory_kb__,int32_t m_uptime_sec__); - - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& cpu_usage_percentage() noexcept { - return m_cpu_usage_percentage_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& cpu_usage_percentage() const noexcept { - return m_cpu_usage_percentage_; - } - - void cpu_usage_percentage(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_cpu_usage_percentage_ = value; - } - - void cpu_usage_percentage(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_cpu_usage_percentage_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& physical_memory_kb() noexcept { - return m_physical_memory_kb_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& physical_memory_kb() const noexcept { - return m_physical_memory_kb_; - } - - void physical_memory_kb(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_physical_memory_kb_ = value; - } - - void physical_memory_kb(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_physical_memory_kb_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& total_memory_kb() noexcept { - return m_total_memory_kb_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& total_memory_kb() const noexcept { - return m_total_memory_kb_; - } - - void total_memory_kb(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_total_memory_kb_ = value; - } - - void total_memory_kb(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_total_memory_kb_ = std::move(value); - } - int32_t& uptime_sec() noexcept { - return m_uptime_sec_; - } - - const int32_t& uptime_sec() const noexcept { - return m_uptime_sec_; - } - - void uptime_sec(int32_t value) { - - m_uptime_sec_ = value; - } - - bool operator == (const ProcessPeriodic& other_) const; - bool operator != (const ProcessPeriodic& other_) const; - - void swap(ProcessPeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_cpu_usage_percentage_; - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_physical_memory_kb_; - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_total_memory_kb_; - int32_t m_uptime_sec_; - - }; - - inline void swap(ProcessPeriodic& a, ProcessPeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ProcessPeriodic& sample); - - class NDDSUSERDllExport ThreadPeriodic { - public: - - ThreadPeriodic(); - - ThreadPeriodic(uint64_t m_id__,const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_cpu_usage_percentage__); - - uint64_t& id() noexcept { - return m_id_; - } - - const uint64_t& id() const noexcept { - return m_id_; - } - - void id(uint64_t value) { - - m_id_ = value; - } - - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& cpu_usage_percentage() noexcept { - return m_cpu_usage_percentage_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& cpu_usage_percentage() const noexcept { - return m_cpu_usage_percentage_; - } - - void cpu_usage_percentage(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_cpu_usage_percentage_ = value; - } - - void cpu_usage_percentage(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_cpu_usage_percentage_ = std::move(value); - } - bool operator == (const ThreadPeriodic& other_) const; - bool operator != (const ThreadPeriodic& other_) const; - - void swap(ThreadPeriodic& other_) noexcept ; - - private: - - uint64_t m_id_; - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_cpu_usage_percentage_; - - }; - - inline void swap(ThreadPeriodic& a, ThreadPeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ThreadPeriodic& sample); - - #if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_COMMON) - // On Windows, dll-export template instantiations of standard types used by - // other dll-exported types - template class NDDSUSERDllExport std::allocator< ::RTI::Service::Monitoring::ThreadPeriodic >; - template class NDDSUSERDllExport std::vector< ::RTI::Service::Monitoring::ThreadPeriodic >; - #endif - class NDDSUSERDllExport ThreadPoolPeriodic { - public: - - ThreadPoolPeriodic(); - - explicit ThreadPoolPeriodic(const ::dds::core::optional< std::vector< ::RTI::Service::Monitoring::ThreadPeriodic > >& m_threads__); - - ::dds::core::optional< std::vector< ::RTI::Service::Monitoring::ThreadPeriodic > >& threads() noexcept { - return m_threads_; - } - - const ::dds::core::optional< std::vector< ::RTI::Service::Monitoring::ThreadPeriodic > >& threads() const noexcept { - return m_threads_; - } - - void threads(const ::dds::core::optional< std::vector< ::RTI::Service::Monitoring::ThreadPeriodic > >& value) { - - m_threads_ = value; - } - - void threads(::dds::core::optional< std::vector< ::RTI::Service::Monitoring::ThreadPeriodic > >&& value) { - m_threads_ = std::move(value); - } - bool operator == (const ThreadPoolPeriodic& other_) const; - bool operator != (const ThreadPoolPeriodic& other_) const; - - void swap(ThreadPoolPeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< std::vector< ::RTI::Service::Monitoring::ThreadPeriodic > > m_threads_; - - }; - - inline void swap(ThreadPoolPeriodic& a, ThreadPoolPeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const ThreadPoolPeriodic& sample); - - class NDDSUSERDllExport HostPeriodic { - public: - - HostPeriodic(); - - HostPeriodic(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_cpu_usage_percentage__,const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_free_memory_kb__,const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_free_swap_memory_kb__,int32_t m_uptime_sec__); - - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& cpu_usage_percentage() noexcept { - return m_cpu_usage_percentage_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& cpu_usage_percentage() const noexcept { - return m_cpu_usage_percentage_; - } - - void cpu_usage_percentage(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_cpu_usage_percentage_ = value; - } - - void cpu_usage_percentage(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_cpu_usage_percentage_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& free_memory_kb() noexcept { - return m_free_memory_kb_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& free_memory_kb() const noexcept { - return m_free_memory_kb_; - } - - void free_memory_kb(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_free_memory_kb_ = value; - } - - void free_memory_kb(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_free_memory_kb_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& free_swap_memory_kb() noexcept { - return m_free_swap_memory_kb_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& free_swap_memory_kb() const noexcept { - return m_free_swap_memory_kb_; - } - - void free_swap_memory_kb(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_free_swap_memory_kb_ = value; - } - - void free_swap_memory_kb(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_free_swap_memory_kb_ = std::move(value); - } - int32_t& uptime_sec() noexcept { - return m_uptime_sec_; - } - - const int32_t& uptime_sec() const noexcept { - return m_uptime_sec_; - } - - void uptime_sec(int32_t value) { - - m_uptime_sec_ = value; - } - - bool operator == (const HostPeriodic& other_) const; - bool operator != (const HostPeriodic& other_) const; - - void swap(HostPeriodic& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_cpu_usage_percentage_; - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_free_memory_kb_; - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_free_swap_memory_kb_; - int32_t m_uptime_sec_; - - }; - - inline void swap(HostPeriodic& a, HostPeriodic& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const HostPeriodic& sample); - - class NDDSUSERDllExport HostConfig { - public: - - HostConfig(); - - HostConfig(const std::string& m_name__,uint32_t m_id__,int64_t m_total_memory_kb__,int64_t m_total_swap_memory_kb__,const std::string& m_target__); - - std::string& name() noexcept { - return m_name_; - } - - const std::string& name() const noexcept { - return m_name_; - } - - void name(const std::string& value) { - - m_name_ = value; - } - - void name(std::string&& value) { - m_name_ = std::move(value); - } - uint32_t& id() noexcept { - return m_id_; - } - - const uint32_t& id() const noexcept { - return m_id_; - } - - void id(uint32_t value) { - - m_id_ = value; - } - - int64_t& total_memory_kb() noexcept { - return m_total_memory_kb_; - } - - const int64_t& total_memory_kb() const noexcept { - return m_total_memory_kb_; - } - - void total_memory_kb(int64_t value) { - - m_total_memory_kb_ = value; - } - - int64_t& total_swap_memory_kb() noexcept { - return m_total_swap_memory_kb_; - } - - const int64_t& total_swap_memory_kb() const noexcept { - return m_total_swap_memory_kb_; - } - - void total_swap_memory_kb(int64_t value) { - - m_total_swap_memory_kb_ = value; - } - - std::string& target() noexcept { - return m_target_; - } - - const std::string& target() const noexcept { - return m_target_; - } - - void target(const std::string& value) { - - m_target_ = value; - } - - void target(std::string&& value) { - m_target_ = std::move(value); - } - bool operator == (const HostConfig& other_) const; - bool operator != (const HostConfig& other_) const; - - void swap(HostConfig& other_) noexcept ; - - private: - - std::string m_name_; - uint32_t m_id_; - int64_t m_total_memory_kb_; - int64_t m_total_swap_memory_kb_; - std::string m_target_; - - }; - - inline void swap(HostConfig& a, HostConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const HostConfig& sample); - - class NDDSUSERDllExport NetworkPerformance { - public: - - NetworkPerformance(); - - NetworkPerformance(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_samples_per_sec__,const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_bytes_per_sec__,const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& m_latency_millisec__); - - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& samples_per_sec() noexcept { - return m_samples_per_sec_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& samples_per_sec() const noexcept { - return m_samples_per_sec_; - } - - void samples_per_sec(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_samples_per_sec_ = value; - } - - void samples_per_sec(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_samples_per_sec_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& bytes_per_sec() noexcept { - return m_bytes_per_sec_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& bytes_per_sec() const noexcept { - return m_bytes_per_sec_; - } - - void bytes_per_sec(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_bytes_per_sec_ = value; - } - - void bytes_per_sec(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_bytes_per_sec_ = std::move(value); - } - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& latency_millisec() noexcept { - return m_latency_millisec_; - } - - const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& latency_millisec() const noexcept { - return m_latency_millisec_; - } - - void latency_millisec(const ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >& value) { - - m_latency_millisec_ = value; - } - - void latency_millisec(::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable >&& value) { - m_latency_millisec_ = std::move(value); - } - bool operator == (const NetworkPerformance& other_) const; - bool operator != (const NetworkPerformance& other_) const; - - void swap(NetworkPerformance& other_) noexcept ; - - private: - - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_samples_per_sec_; - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_bytes_per_sec_; - ::dds::core::optional< ::RTI::Service::Monitoring::StatisticVariable > m_latency_millisec_; - - }; - - inline void swap(NetworkPerformance& a, NetworkPerformance& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const NetworkPerformance& sample); - - class NDDSUSERDllExport EntityConfig { - public: - - EntityConfig(); - - EntityConfig(const std::string& m_resource_id__,const std::string& m_configuration__); - - std::string& resource_id() noexcept { - return m_resource_id_; - } - - const std::string& resource_id() const noexcept { - return m_resource_id_; - } - - void resource_id(const std::string& value) { - - m_resource_id_ = value; - } - - void resource_id(std::string&& value) { - m_resource_id_ = std::move(value); - } - std::string& configuration() noexcept { - return m_configuration_; - } - - const std::string& configuration() const noexcept { - return m_configuration_; - } - - void configuration(const std::string& value) { - - m_configuration_ = value; - } - - void configuration(std::string&& value) { - m_configuration_ = std::move(value); - } - bool operator == (const EntityConfig& other_) const; - bool operator != (const EntityConfig& other_) const; - - void swap(EntityConfig& other_) noexcept ; - - private: - - std::string m_resource_id_; - std::string m_configuration_; - - }; - - inline void swap(EntityConfig& a, EntityConfig& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const EntityConfig& sample); - - class NDDSUSERDllExport EntityEvent { - public: - - EntityEvent(); - - explicit EntityEvent(const ::RTI::Service::EntityStateKind& m_state__); - - ::RTI::Service::EntityStateKind& state() noexcept { - return m_state_; - } - - const ::RTI::Service::EntityStateKind& state() const noexcept { - return m_state_; - } - - void state(const ::RTI::Service::EntityStateKind& value) { - - m_state_ = value; - } - - void state(::RTI::Service::EntityStateKind&& value) { - m_state_ = std::move(value); - } - bool operator == (const EntityEvent& other_) const; - bool operator != (const EntityEvent& other_) const; - - void swap(EntityEvent& other_) noexcept ; - - private: - - ::RTI::Service::EntityStateKind m_state_; - - }; - - inline void swap(EntityEvent& a, EntityEvent& b) noexcept - { - a.swap(b); - } - - NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const EntityEvent& sample); - - enum class DistributionTopicKind { - CONFIG, - EVENT, - PERIODIC - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const DistributionTopicKind& sample); - enum class ResourceKindIndex { - DDS_INDEX = 1, - ROUTING_INDEX = 10000, - RECORDING_INDEX = 20000, - CDS_INDEX = 30000 - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const ResourceKindIndex& sample); - enum class ResourceKind { - UNKNOWN, - ROUTING_SERVICE = 10000, - ROUTING_DOMAIN_ROUTE, - ROUTING_SESSION, - ROUTING_AUTO_ROUTE, - ROUTING_ROUTE, - ROUTING_INPUT, - ROUTING_OUTPUT, - RECORDING_SERVICE = 20000, - RECORDING_SESSION, - RECORDING_TOPIC_GROUP, - RECORDING_TOPIC, - CDS_SERVICE = 30000, - CDS_FORWARDER, - CDS_DATABASE, - CDS_RECEIVER, - CDS_SENDER - }; - - NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const ResourceKind& sample); - - static const std::string CONFIG_TOPIC_NAME = "rti/service/monitoring/config"; - - static const std::string EVENT_TOPIC_NAME = "rti/service/monitoring/event"; - - static const std::string PERIODIC_TOPIC_NAME = "rti/service/monitoring/periodic"; - - static const std::string CONFIG_REGISTERED_TYPE_NAME = "RTI::Service::Monitoring::Config"; - - static const std::string EVENT_REGISTERED_TYPE_NAME = "RTI::Service::Monitoring::Event"; - - static const std::string PERIODIC_REGISTERED_TYPE_NAME = "RTI::Service::Monitoring::Periodic"; - } // namespace Monitoring - } // namespace Service -} // namespace RTI - -#ifdef NDDS_STANDALONE_TYPE -namespace rti { - namespace topic { - template <> - struct default_enumerator< ::RTI::Service::EntityStateKind> - { - static const ::RTI::Service::EntityStateKind value; - }; - template <> - struct default_enumerator< ::RTI::Service::Monitoring::DistributionTopicKind> - { - static const ::RTI::Service::Monitoring::DistributionTopicKind value; - }; - template <> - struct default_enumerator< ::RTI::Service::Monitoring::ResourceKindIndex> - { - static const ::RTI::Service::Monitoring::ResourceKindIndex value; - }; - template <> - struct default_enumerator< ::RTI::Service::Monitoring::ResourceKind> - { - static const ::RTI::Service::Monitoring::ResourceKind value; - }; - } -} -#else - -namespace rti { - namespace flat { - namespace topic { - } - } -} -namespace dds { - namespace topic { - - template<> - struct topic_type_name< ::RTI::Service::EntityState > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::EntityState"; - } - }; - - template<> - struct is_topic_type< ::RTI::Service::EntityState > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::Service::EntityState > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::Service::EntityState& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::Service::EntityState& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::Service::EntityState& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::EntityState& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::BuiltinTopicKey > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::BuiltinTopicKey"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::BuiltinTopicKey > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::BuiltinTopicKey& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::BuiltinTopicKey& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::ResourceGuid > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::ResourceGuid"; - } - }; - - template<> - struct is_topic_type< ::RTI::Service::Monitoring::ResourceGuid > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::ResourceGuid > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::Service::Monitoring::ResourceGuid& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::Service::Monitoring::ResourceGuid& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::ResourceGuid& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::ResourceGuid& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::KeyedResource > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::KeyedResource"; - } - }; - - template<> - struct is_topic_type< ::RTI::Service::Monitoring::KeyedResource > : public ::dds::core::true_type {}; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::KeyedResource > { - NDDSUSERDllExport - static void register_type( - ::dds::domain::DomainParticipant& participant, - const std::string & type_name); - - NDDSUSERDllExport - static std::vector& to_cdr_buffer( - std::vector& buffer, - const ::RTI::Service::Monitoring::KeyedResource& sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::auto_id()); - - NDDSUSERDllExport - static void from_cdr_buffer(::RTI::Service::Monitoring::KeyedResource& sample, const std::vector& buffer); - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::KeyedResource& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::KeyedResource& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::StatisticMetrics > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::StatisticMetrics"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::StatisticMetrics > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::StatisticMetrics& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::StatisticMetrics& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::StatisticVariable > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::StatisticVariable"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::StatisticVariable > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::StatisticVariable& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::StatisticVariable& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::CountStatus > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::CountStatus"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::CountStatus > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::CountStatus& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::CountStatus& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::ProcessConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::ProcessConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::ProcessConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::ProcessConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::ProcessConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::ProcessPeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::ProcessPeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::ProcessPeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::ProcessPeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::ProcessPeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::ThreadPeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::ThreadPeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::ThreadPeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::ThreadPeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::ThreadPeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::ThreadPoolPeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::ThreadPoolPeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::ThreadPoolPeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::ThreadPoolPeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::ThreadPoolPeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::HostPeriodic > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::HostPeriodic"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::HostPeriodic > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::HostPeriodic& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::HostPeriodic& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::HostConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::HostConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::HostConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::HostConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::HostConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::NetworkPerformance > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::NetworkPerformance"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::NetworkPerformance > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::NetworkPerformance& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::NetworkPerformance& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::EntityConfig > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::EntityConfig"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::EntityConfig > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::EntityConfig& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::EntityConfig& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - template<> - struct topic_type_name< ::RTI::Service::Monitoring::EntityEvent > { - NDDSUSERDllExport static std::string value() { - return "RTI::Service::Monitoring::EntityEvent"; - } - }; - - template<> - struct topic_type_support< ::RTI::Service::Monitoring::EntityEvent > { - NDDSUSERDllExport - static void reset_sample(::RTI::Service::Monitoring::EntityEvent& sample); - - NDDSUSERDllExport - static void allocate_sample(::RTI::Service::Monitoring::EntityEvent& sample, int, int); - - static const ::rti::topic::TypePluginKind::type type_plugin_kind = - ::rti::topic::TypePluginKind::STL; - }; - } -} - -namespace rti { - namespace topic { - - template<> - struct dynamic_type< ::RTI::Service::BoundedString_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template<> - struct dynamic_type< ::RTI::Service::FilePath_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template<> - struct dynamic_type< ::RTI::Service::ResourceId_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template<> - struct dynamic_type< ::RTI::Service::XmlString_AliasTag_t > { - typedef ::dds::core::xtypes::AliasType type; - NDDSUSERDllExport static const ::dds::core::xtypes::AliasType& get(); - }; - - template <> - struct default_enumerator< ::RTI::Service::EntityStateKind> - { - static const ::RTI::Service::EntityStateKind value; - }; - template<> - struct dynamic_type< ::RTI::Service::EntityStateKind > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::EntityStateKind > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::EntityState > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::EntityState > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::BuiltinTopicKey > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::BuiltinTopicKey > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::FINAL; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::ResourceGuid > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::ResourceGuid > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::FINAL; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::KeyedResource > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::KeyedResource > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::StatisticMetrics > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::StatisticMetrics > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::StatisticVariable > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::StatisticVariable > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::CountStatus > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::CountStatus > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::ProcessConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::ProcessConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::ProcessPeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::ProcessPeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::ThreadPeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::ThreadPeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::ThreadPoolPeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::ThreadPoolPeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::HostPeriodic > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::HostPeriodic > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::HostConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::HostConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::NetworkPerformance > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::NetworkPerformance > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::EntityConfig > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::EntityConfig > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template<> - struct dynamic_type< ::RTI::Service::Monitoring::EntityEvent > { - typedef ::dds::core::xtypes::StructType type; - NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::EntityEvent > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template <> - struct default_enumerator< ::RTI::Service::Monitoring::DistributionTopicKind> - { - static const ::RTI::Service::Monitoring::DistributionTopicKind value; - }; - template<> - struct dynamic_type< ::RTI::Service::Monitoring::DistributionTopicKind > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::DistributionTopicKind > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; }; - - template <> - struct default_enumerator< ::RTI::Service::Monitoring::ResourceKindIndex> - { - static const ::RTI::Service::Monitoring::ResourceKindIndex value; - }; - template<> - struct dynamic_type< ::RTI::Service::Monitoring::ResourceKindIndex > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::ResourceKindIndex > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - template <> - struct default_enumerator< ::RTI::Service::Monitoring::ResourceKind> - { - static const ::RTI::Service::Monitoring::ResourceKind value; - }; - template<> - struct dynamic_type< ::RTI::Service::Monitoring::ResourceKind > { - typedef ::dds::core::xtypes::EnumType type; - NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get(); - }; - - template <> - struct extensibility< ::RTI::Service::Monitoring::ResourceKind > { - static const ::dds::core::xtypes::ExtensibilityKind::type kind = - ::dds::core::xtypes::ExtensibilityKind::MUTABLE; }; - - } -} - -#endif // NDDS_STANDALONE_TYPE -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_COMMON) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif // ServiceCommon_1902811798_hpp diff --git a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommonPlugin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommonPlugin.hpp deleted file mode 100644 index caebeeef0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/idlgen/ServiceCommonPlugin.hpp +++ /dev/null @@ -1,2625 +0,0 @@ - - -/* -WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. - -This file was generated from ServiceCommon.idl -using RTI Code Generator (rtiddsgen) version 4.7.0. -The rtiddsgen tool is part of the RTI Connext DDS distribution. -For more information, type 'rtiddsgen -help' at a command shell -or consult the Code Generator User's Manual. -*/ - -#ifndef ServiceCommonPlugin_1902811798_h -#define ServiceCommonPlugin_1902811798_h - -#include "ServiceCommon.hpp" - -struct RTICdrStream; - -#ifndef pres_typePlugin_h -#include "pres/pres_typePlugin.h" -#endif - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_COMMON) && defined(RTI_WIN32) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __declspec(dllexport) -#endif - -#if !defined(RTI_WIN32) && defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport __attribute__((visibility("default"))) -#endif - -namespace RTI { - namespace Service { - - #define BoundedStringPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define BoundedStringPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define BoundedStringPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define BoundedStringPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define BoundedStringPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern BoundedString* - BoundedStringPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern BoundedString* - BoundedStringPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern BoundedString* - BoundedStringPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - BoundedStringPluginSupport_copy_data( - BoundedString *out, - const BoundedString *in); - - NDDSUSERDllExport extern void - BoundedStringPluginSupport_destroy_data_w_params( - BoundedString *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - BoundedStringPluginSupport_destroy_data_ex( - BoundedString *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - BoundedStringPluginSupport_destroy_data( - BoundedString *sample); - - NDDSUSERDllExport extern void - BoundedStringPluginSupport_print_data( - const BoundedString *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - BoundedStringPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - BoundedString *out, - const BoundedString *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - BoundedStringPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - BoundedStringPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - BoundedStringPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - BoundedStringPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - #define FilePathPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define FilePathPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define FilePathPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define FilePathPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define FilePathPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern FilePath* - FilePathPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern FilePath* - FilePathPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern FilePath* - FilePathPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - FilePathPluginSupport_copy_data( - FilePath *out, - const FilePath *in); - - NDDSUSERDllExport extern void - FilePathPluginSupport_destroy_data_w_params( - FilePath *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - FilePathPluginSupport_destroy_data_ex( - FilePath *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - FilePathPluginSupport_destroy_data( - FilePath *sample); - - NDDSUSERDllExport extern void - FilePathPluginSupport_print_data( - const FilePath *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - FilePathPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - FilePath *out, - const FilePath *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - FilePathPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - FilePathPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - FilePathPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - FilePathPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - #define ResourceIdPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ResourceIdPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ResourceIdPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ResourceIdPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ResourceIdPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ResourceId* - ResourceIdPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ResourceId* - ResourceIdPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ResourceId* - ResourceIdPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ResourceIdPluginSupport_copy_data( - ResourceId *out, - const ResourceId *in); - - NDDSUSERDllExport extern void - ResourceIdPluginSupport_destroy_data_w_params( - ResourceId *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ResourceIdPluginSupport_destroy_data_ex( - ResourceId *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ResourceIdPluginSupport_destroy_data( - ResourceId *sample); - - NDDSUSERDllExport extern void - ResourceIdPluginSupport_print_data( - const ResourceId *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ResourceIdPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ResourceId *out, - const ResourceId *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ResourceIdPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ResourceIdPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ResourceIdPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ResourceIdPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - #define XmlStringPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define XmlStringPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define XmlStringPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define XmlStringPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define XmlStringPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern XmlString* - XmlStringPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern XmlString* - XmlStringPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern XmlString* - XmlStringPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - XmlStringPluginSupport_copy_data( - XmlString *out, - const XmlString *in); - - NDDSUSERDllExport extern void - XmlStringPluginSupport_destroy_data_w_params( - XmlString *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - XmlStringPluginSupport_destroy_data_ex( - XmlString *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - XmlStringPluginSupport_destroy_data( - XmlString *sample); - - NDDSUSERDllExport extern void - XmlStringPluginSupport_print_data( - const XmlString *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - XmlStringPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - XmlString *out, - const XmlString *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - XmlStringPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - XmlStringPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - XmlStringPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - XmlStringPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - EntityStateKindPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - EntityStateKindPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - EntityStateKindPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - EntityStateKindPluginSupport_print_data( - const EntityStateKind *sample, - const char *desc, - unsigned int indent_level); - - #define EntityStatePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define EntityStatePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define EntityStatePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define EntityStatePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define EntityStatePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern EntityState* - EntityStatePluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern EntityState* - EntityStatePluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern EntityState* - EntityStatePluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - EntityStatePluginSupport_copy_data( - EntityState *out, - const EntityState *in); - - NDDSUSERDllExport extern void - EntityStatePluginSupport_destroy_data_w_params( - EntityState *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - EntityStatePluginSupport_destroy_data_ex( - EntityState *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - EntityStatePluginSupport_destroy_data( - EntityState *sample); - - NDDSUSERDllExport extern void - EntityStatePluginSupport_print_data( - const EntityState *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - EntityStatePlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - EntityStatePlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - EntityStatePlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - EntityStatePlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - EntityStatePlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - EntityState *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - EntityStatePlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - EntityState *out, - const EntityState *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EntityStatePlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const EntityState *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - EntityStatePlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - EntityState **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - EntityStatePlugin_deserialize_from_cdr_buffer( - EntityState *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - EntityStatePlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - EntityStatePlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - EntityStatePlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - EntityStatePlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - EntityStatePlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - EntityState ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - EntityStatePlugin_new(void); - - NDDSUSERDllExport extern void - EntityStatePlugin_delete(struct PRESTypePlugin *); - - #define BuiltinTopicKeyPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define BuiltinTopicKeyPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define BuiltinTopicKeyPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define BuiltinTopicKeyPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define BuiltinTopicKeyPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern BuiltinTopicKey* - BuiltinTopicKeyPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern BuiltinTopicKey* - BuiltinTopicKeyPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern BuiltinTopicKey* - BuiltinTopicKeyPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - BuiltinTopicKeyPluginSupport_copy_data( - BuiltinTopicKey *out, - const BuiltinTopicKey *in); - - NDDSUSERDllExport extern void - BuiltinTopicKeyPluginSupport_destroy_data_w_params( - BuiltinTopicKey *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - BuiltinTopicKeyPluginSupport_destroy_data_ex( - BuiltinTopicKey *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - BuiltinTopicKeyPluginSupport_destroy_data( - BuiltinTopicKey *sample); - - NDDSUSERDllExport extern void - BuiltinTopicKeyPluginSupport_print_data( - const BuiltinTopicKey *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - BuiltinTopicKeyPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - BuiltinTopicKey *out, - const BuiltinTopicKey *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - BuiltinTopicKeyPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const BuiltinTopicKey *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - BuiltinTopicKeyPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - BuiltinTopicKey **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - BuiltinTopicKeyPlugin_deserialize_from_cdr_buffer( - BuiltinTopicKey *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - BuiltinTopicKeyPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - BuiltinTopicKeyPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - BuiltinTopicKeyPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - BuiltinTopicKeyPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - BuiltinTopicKeyPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - BuiltinTopicKey ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - namespace Monitoring { - - #define ResourceGuidPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ResourceGuidPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ResourceGuidPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ResourceGuidPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ResourceGuidPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ResourceGuid* - ResourceGuidPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ResourceGuid* - ResourceGuidPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ResourceGuid* - ResourceGuidPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ResourceGuidPluginSupport_copy_data( - ResourceGuid *out, - const ResourceGuid *in); - - NDDSUSERDllExport extern void - ResourceGuidPluginSupport_destroy_data_w_params( - ResourceGuid *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ResourceGuidPluginSupport_destroy_data_ex( - ResourceGuid *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ResourceGuidPluginSupport_destroy_data( - ResourceGuid *sample); - - NDDSUSERDllExport extern void - ResourceGuidPluginSupport_print_data( - const ResourceGuid *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - ResourceGuidPlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - ResourceGuidPlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - ResourceGuidPlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - ResourceGuidPlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - ResourceGuidPlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - ResourceGuid *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - ResourceGuidPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ResourceGuid *out, - const ResourceGuid *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ResourceGuidPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ResourceGuid *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ResourceGuidPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ResourceGuid **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ResourceGuidPlugin_deserialize_from_cdr_buffer( - ResourceGuid *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ResourceGuidPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ResourceGuidPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ResourceGuidPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ResourceGuidPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ResourceGuidPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ResourceGuid ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - ResourceGuidPlugin_new(void); - - NDDSUSERDllExport extern void - ResourceGuidPlugin_delete(struct PRESTypePlugin *); - - /* The type used to store keys for instances of type struct - * AnotherSimple. - * - * By default, this type is struct KeyedResource - * itself. However, if for some reason this choice is not practical for your - * system (e.g. if sizeof(struct KeyedResource) - * is very large), you may redefine this typedef in terms of another type of - * your choosing. HOWEVER, if you define the KeyHolder type to be something - * other than struct AnotherSimple, the - * following restriction applies: the key of struct - * KeyedResource must consist of a - * single field of your redefined KeyHolder type and that field must be the - * first field in struct KeyedResource. - */ - typedef class KeyedResource KeyedResourceKeyHolder; - - #define KeyedResourcePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define KeyedResourcePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define KeyedResourcePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define KeyedResourcePlugin_get_key PRESTypePluginDefaultEndpointData_getKey - #define KeyedResourcePlugin_return_key PRESTypePluginDefaultEndpointData_returnKey - - #define KeyedResourcePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define KeyedResourcePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern KeyedResource* - KeyedResourcePluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern KeyedResource* - KeyedResourcePluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern KeyedResource* - KeyedResourcePluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePluginSupport_copy_data( - KeyedResource *out, - const KeyedResource *in); - - NDDSUSERDllExport extern void - KeyedResourcePluginSupport_destroy_data_w_params( - KeyedResource *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - KeyedResourcePluginSupport_destroy_data_ex( - KeyedResource *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - KeyedResourcePluginSupport_destroy_data( - KeyedResource *sample); - - NDDSUSERDllExport extern void - KeyedResourcePluginSupport_print_data( - const KeyedResource *sample, - const char *desc, - unsigned int indent); - - NDDSUSERDllExport extern KeyedResource* - KeyedResourcePluginSupport_create_key_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern KeyedResource* - KeyedResourcePluginSupport_create_key(void); - - NDDSUSERDllExport extern void - KeyedResourcePluginSupport_destroy_key_ex( - KeyedResourceKeyHolder *key,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - KeyedResourcePluginSupport_destroy_key( - KeyedResourceKeyHolder *key); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern PRESTypePluginParticipantData - KeyedResourcePlugin_on_participant_attached( - void *registration_data, - const struct PRESTypePluginParticipantInfo *participant_info, - RTIBool top_level_registration, - void *container_plugin_context, - RTICdrTypeCode *typeCode); - - NDDSUSERDllExport extern void - KeyedResourcePlugin_on_participant_detached( - PRESTypePluginParticipantData participant_data); - - NDDSUSERDllExport extern PRESTypePluginEndpointData - KeyedResourcePlugin_on_endpoint_attached( - PRESTypePluginParticipantData participant_data, - const struct PRESTypePluginEndpointInfo *endpoint_info, - RTIBool top_level_registration, - void *container_plugin_context); - - NDDSUSERDllExport extern void - KeyedResourcePlugin_on_endpoint_detached( - PRESTypePluginEndpointData endpoint_data); - - NDDSUSERDllExport extern void - KeyedResourcePlugin_return_sample( - PRESTypePluginEndpointData endpoint_data, - KeyedResource *sample, - void *handle); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - KeyedResource *out, - const KeyedResource *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const KeyedResource *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - KeyedResource **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_deserialize_from_cdr_buffer( - KeyedResource *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - KeyedResourcePlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - KeyedResourcePlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - KeyedResourcePlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - KeyedResourcePlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - KeyedResource ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_instance_to_key( - PRESTypePluginEndpointData endpoint_data, - KeyedResourceKeyHolder *key, - const KeyedResource *instance); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_key_to_instance( - PRESTypePluginEndpointData endpoint_data, - KeyedResource *instance, - const KeyedResourceKeyHolder *key); - - NDDSUSERDllExport extern RTIBool - KeyedResourcePlugin_serialized_sample_to_keyhash( - PRESTypePluginEndpointData endpoint_data, - struct RTICdrStream *cdrStream, - DDS_KeyHash_t *keyhash, - RTIBool deserialize_encapsulation, - void *endpoint_plugin_qos); - - /* Plugin Functions */ - NDDSUSERDllExport extern struct PRESTypePlugin* - KeyedResourcePlugin_new(void); - - NDDSUSERDllExport extern void - KeyedResourcePlugin_delete(struct PRESTypePlugin *); - - #define StatisticMetricsPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define StatisticMetricsPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define StatisticMetricsPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define StatisticMetricsPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define StatisticMetricsPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern StatisticMetrics* - StatisticMetricsPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern StatisticMetrics* - StatisticMetricsPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern StatisticMetrics* - StatisticMetricsPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - StatisticMetricsPluginSupport_copy_data( - StatisticMetrics *out, - const StatisticMetrics *in); - - NDDSUSERDllExport extern void - StatisticMetricsPluginSupport_destroy_data_w_params( - StatisticMetrics *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - StatisticMetricsPluginSupport_destroy_data_ex( - StatisticMetrics *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - StatisticMetricsPluginSupport_destroy_data( - StatisticMetrics *sample); - - NDDSUSERDllExport extern void - StatisticMetricsPluginSupport_print_data( - const StatisticMetrics *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - StatisticMetricsPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - StatisticMetrics *out, - const StatisticMetrics *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - StatisticMetricsPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const StatisticMetrics *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - StatisticMetricsPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - StatisticMetrics **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - StatisticMetricsPlugin_deserialize_from_cdr_buffer( - StatisticMetrics *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - StatisticMetricsPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - StatisticMetricsPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - StatisticMetricsPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - StatisticMetricsPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - StatisticMetricsPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - StatisticMetrics ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define StatisticVariablePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define StatisticVariablePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define StatisticVariablePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define StatisticVariablePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define StatisticVariablePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern StatisticVariable* - StatisticVariablePluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern StatisticVariable* - StatisticVariablePluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern StatisticVariable* - StatisticVariablePluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - StatisticVariablePluginSupport_copy_data( - StatisticVariable *out, - const StatisticVariable *in); - - NDDSUSERDllExport extern void - StatisticVariablePluginSupport_destroy_data_w_params( - StatisticVariable *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - StatisticVariablePluginSupport_destroy_data_ex( - StatisticVariable *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - StatisticVariablePluginSupport_destroy_data( - StatisticVariable *sample); - - NDDSUSERDllExport extern void - StatisticVariablePluginSupport_print_data( - const StatisticVariable *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - StatisticVariablePlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - StatisticVariable *out, - const StatisticVariable *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - StatisticVariablePlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const StatisticVariable *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - StatisticVariablePlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - StatisticVariable **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - StatisticVariablePlugin_deserialize_from_cdr_buffer( - StatisticVariable *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - StatisticVariablePlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - StatisticVariablePlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - StatisticVariablePlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - StatisticVariablePlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - StatisticVariablePlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - StatisticVariable ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define CountStatusPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define CountStatusPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define CountStatusPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define CountStatusPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define CountStatusPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern CountStatus* - CountStatusPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern CountStatus* - CountStatusPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern CountStatus* - CountStatusPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - CountStatusPluginSupport_copy_data( - CountStatus *out, - const CountStatus *in); - - NDDSUSERDllExport extern void - CountStatusPluginSupport_destroy_data_w_params( - CountStatus *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - CountStatusPluginSupport_destroy_data_ex( - CountStatus *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - CountStatusPluginSupport_destroy_data( - CountStatus *sample); - - NDDSUSERDllExport extern void - CountStatusPluginSupport_print_data( - const CountStatus *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - CountStatusPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - CountStatus *out, - const CountStatus *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - CountStatusPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const CountStatus *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - CountStatusPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - CountStatus **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - CountStatusPlugin_deserialize_from_cdr_buffer( - CountStatus *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - CountStatusPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - CountStatusPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - CountStatusPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - CountStatusPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - CountStatusPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - CountStatus ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ProcessConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ProcessConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ProcessConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ProcessConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ProcessConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ProcessConfig* - ProcessConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ProcessConfig* - ProcessConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ProcessConfig* - ProcessConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ProcessConfigPluginSupport_copy_data( - ProcessConfig *out, - const ProcessConfig *in); - - NDDSUSERDllExport extern void - ProcessConfigPluginSupport_destroy_data_w_params( - ProcessConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ProcessConfigPluginSupport_destroy_data_ex( - ProcessConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ProcessConfigPluginSupport_destroy_data( - ProcessConfig *sample); - - NDDSUSERDllExport extern void - ProcessConfigPluginSupport_print_data( - const ProcessConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ProcessConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ProcessConfig *out, - const ProcessConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ProcessConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ProcessConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ProcessConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ProcessConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ProcessConfigPlugin_deserialize_from_cdr_buffer( - ProcessConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ProcessConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ProcessConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ProcessConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ProcessConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ProcessConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ProcessConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ProcessPeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ProcessPeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ProcessPeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ProcessPeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ProcessPeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ProcessPeriodic* - ProcessPeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ProcessPeriodic* - ProcessPeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ProcessPeriodic* - ProcessPeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ProcessPeriodicPluginSupport_copy_data( - ProcessPeriodic *out, - const ProcessPeriodic *in); - - NDDSUSERDllExport extern void - ProcessPeriodicPluginSupport_destroy_data_w_params( - ProcessPeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ProcessPeriodicPluginSupport_destroy_data_ex( - ProcessPeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ProcessPeriodicPluginSupport_destroy_data( - ProcessPeriodic *sample); - - NDDSUSERDllExport extern void - ProcessPeriodicPluginSupport_print_data( - const ProcessPeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ProcessPeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ProcessPeriodic *out, - const ProcessPeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ProcessPeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ProcessPeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ProcessPeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ProcessPeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ProcessPeriodicPlugin_deserialize_from_cdr_buffer( - ProcessPeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ProcessPeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ProcessPeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ProcessPeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ProcessPeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ProcessPeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ProcessPeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ThreadPeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ThreadPeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ThreadPeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ThreadPeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ThreadPeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ThreadPeriodic* - ThreadPeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ThreadPeriodic* - ThreadPeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ThreadPeriodic* - ThreadPeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ThreadPeriodicPluginSupport_copy_data( - ThreadPeriodic *out, - const ThreadPeriodic *in); - - NDDSUSERDllExport extern void - ThreadPeriodicPluginSupport_destroy_data_w_params( - ThreadPeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ThreadPeriodicPluginSupport_destroy_data_ex( - ThreadPeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ThreadPeriodicPluginSupport_destroy_data( - ThreadPeriodic *sample); - - NDDSUSERDllExport extern void - ThreadPeriodicPluginSupport_print_data( - const ThreadPeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ThreadPeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ThreadPeriodic *out, - const ThreadPeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ThreadPeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ThreadPeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ThreadPeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ThreadPeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ThreadPeriodicPlugin_deserialize_from_cdr_buffer( - ThreadPeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ThreadPeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ThreadPeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ThreadPeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ThreadPeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ThreadPeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ThreadPeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define ThreadPoolPeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define ThreadPoolPeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define ThreadPoolPeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define ThreadPoolPeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define ThreadPoolPeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern ThreadPoolPeriodic* - ThreadPoolPeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern ThreadPoolPeriodic* - ThreadPoolPeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern ThreadPoolPeriodic* - ThreadPoolPeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - ThreadPoolPeriodicPluginSupport_copy_data( - ThreadPoolPeriodic *out, - const ThreadPoolPeriodic *in); - - NDDSUSERDllExport extern void - ThreadPoolPeriodicPluginSupport_destroy_data_w_params( - ThreadPoolPeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - ThreadPoolPeriodicPluginSupport_destroy_data_ex( - ThreadPoolPeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - ThreadPoolPeriodicPluginSupport_destroy_data( - ThreadPoolPeriodic *sample); - - NDDSUSERDllExport extern void - ThreadPoolPeriodicPluginSupport_print_data( - const ThreadPoolPeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ThreadPoolPeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - ThreadPoolPeriodic *out, - const ThreadPoolPeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - ThreadPoolPeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const ThreadPoolPeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - ThreadPoolPeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - ThreadPoolPeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - ThreadPoolPeriodicPlugin_deserialize_from_cdr_buffer( - ThreadPoolPeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - ThreadPoolPeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - ThreadPoolPeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - ThreadPoolPeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ThreadPoolPeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - ThreadPoolPeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - ThreadPoolPeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define HostPeriodicPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define HostPeriodicPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define HostPeriodicPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define HostPeriodicPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define HostPeriodicPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern HostPeriodic* - HostPeriodicPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern HostPeriodic* - HostPeriodicPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern HostPeriodic* - HostPeriodicPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - HostPeriodicPluginSupport_copy_data( - HostPeriodic *out, - const HostPeriodic *in); - - NDDSUSERDllExport extern void - HostPeriodicPluginSupport_destroy_data_w_params( - HostPeriodic *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - HostPeriodicPluginSupport_destroy_data_ex( - HostPeriodic *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - HostPeriodicPluginSupport_destroy_data( - HostPeriodic *sample); - - NDDSUSERDllExport extern void - HostPeriodicPluginSupport_print_data( - const HostPeriodic *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - HostPeriodicPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - HostPeriodic *out, - const HostPeriodic *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - HostPeriodicPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const HostPeriodic *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - HostPeriodicPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - HostPeriodic **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - HostPeriodicPlugin_deserialize_from_cdr_buffer( - HostPeriodic *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - HostPeriodicPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - HostPeriodicPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - HostPeriodicPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - HostPeriodicPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - HostPeriodicPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - HostPeriodic ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define HostConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define HostConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define HostConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define HostConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define HostConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern HostConfig* - HostConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern HostConfig* - HostConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern HostConfig* - HostConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - HostConfigPluginSupport_copy_data( - HostConfig *out, - const HostConfig *in); - - NDDSUSERDllExport extern void - HostConfigPluginSupport_destroy_data_w_params( - HostConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - HostConfigPluginSupport_destroy_data_ex( - HostConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - HostConfigPluginSupport_destroy_data( - HostConfig *sample); - - NDDSUSERDllExport extern void - HostConfigPluginSupport_print_data( - const HostConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - HostConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - HostConfig *out, - const HostConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - HostConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const HostConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - HostConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - HostConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - HostConfigPlugin_deserialize_from_cdr_buffer( - HostConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - HostConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - HostConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - HostConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - HostConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - HostConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - HostConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define NetworkPerformancePlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define NetworkPerformancePlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define NetworkPerformancePlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define NetworkPerformancePlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define NetworkPerformancePlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern NetworkPerformance* - NetworkPerformancePluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern NetworkPerformance* - NetworkPerformancePluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern NetworkPerformance* - NetworkPerformancePluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - NetworkPerformancePluginSupport_copy_data( - NetworkPerformance *out, - const NetworkPerformance *in); - - NDDSUSERDllExport extern void - NetworkPerformancePluginSupport_destroy_data_w_params( - NetworkPerformance *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - NetworkPerformancePluginSupport_destroy_data_ex( - NetworkPerformance *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - NetworkPerformancePluginSupport_destroy_data( - NetworkPerformance *sample); - - NDDSUSERDllExport extern void - NetworkPerformancePluginSupport_print_data( - const NetworkPerformance *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - NetworkPerformancePlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - NetworkPerformance *out, - const NetworkPerformance *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - NetworkPerformancePlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const NetworkPerformance *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - NetworkPerformancePlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - NetworkPerformance **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - NetworkPerformancePlugin_deserialize_from_cdr_buffer( - NetworkPerformance *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - NetworkPerformancePlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - NetworkPerformancePlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - NetworkPerformancePlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - NetworkPerformancePlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - NetworkPerformancePlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - NetworkPerformance ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define EntityConfigPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define EntityConfigPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define EntityConfigPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define EntityConfigPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define EntityConfigPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern EntityConfig* - EntityConfigPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern EntityConfig* - EntityConfigPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern EntityConfig* - EntityConfigPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - EntityConfigPluginSupport_copy_data( - EntityConfig *out, - const EntityConfig *in); - - NDDSUSERDllExport extern void - EntityConfigPluginSupport_destroy_data_w_params( - EntityConfig *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - EntityConfigPluginSupport_destroy_data_ex( - EntityConfig *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - EntityConfigPluginSupport_destroy_data( - EntityConfig *sample); - - NDDSUSERDllExport extern void - EntityConfigPluginSupport_print_data( - const EntityConfig *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EntityConfigPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - EntityConfig *out, - const EntityConfig *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EntityConfigPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const EntityConfig *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - EntityConfigPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - EntityConfig **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - EntityConfigPlugin_deserialize_from_cdr_buffer( - EntityConfig *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - EntityConfigPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - EntityConfigPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - EntityConfigPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - EntityConfigPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - EntityConfigPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - EntityConfig ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - #define EntityEventPlugin_get_sample PRESTypePluginDefaultEndpointData_getSample - - #define EntityEventPlugin_get_buffer PRESTypePluginDefaultEndpointData_getBuffer - #define EntityEventPlugin_return_buffer PRESTypePluginDefaultEndpointData_returnBuffer - - #define EntityEventPlugin_create_sample PRESTypePluginDefaultEndpointData_createSample - #define EntityEventPlugin_destroy_sample PRESTypePluginDefaultEndpointData_deleteSample - - /* -------------------------------------------------------------------------------------- - Support functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern EntityEvent* - EntityEventPluginSupport_create_data_w_params( - const struct DDS_TypeAllocationParams_t * alloc_params); - - NDDSUSERDllExport extern EntityEvent* - EntityEventPluginSupport_create_data_ex(RTIBool allocate_pointers); - - NDDSUSERDllExport extern EntityEvent* - EntityEventPluginSupport_create_data(void); - - NDDSUSERDllExport extern RTIBool - EntityEventPluginSupport_copy_data( - EntityEvent *out, - const EntityEvent *in); - - NDDSUSERDllExport extern void - EntityEventPluginSupport_destroy_data_w_params( - EntityEvent *sample, - const struct DDS_TypeDeallocationParams_t * dealloc_params); - - NDDSUSERDllExport extern void - EntityEventPluginSupport_destroy_data_ex( - EntityEvent *sample,RTIBool deallocate_pointers); - - NDDSUSERDllExport extern void - EntityEventPluginSupport_destroy_data( - EntityEvent *sample); - - NDDSUSERDllExport extern void - EntityEventPluginSupport_print_data( - const EntityEvent *sample, - const char *desc, - unsigned int indent); - - /* ---------------------------------------------------------------------------- - Callback functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EntityEventPlugin_copy_sample( - PRESTypePluginEndpointData endpoint_data, - EntityEvent *out, - const EntityEvent *in); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern RTIBool - EntityEventPlugin_serialize_to_cdr_buffer( - char * buffer, - unsigned int * length, - const EntityEvent *sample, - ::dds::core::policy::DataRepresentationId representation - = ::dds::core::policy::DataRepresentation::xcdr()); - - NDDSUSERDllExport extern RTIBool - EntityEventPlugin_deserialize( - PRESTypePluginEndpointData endpoint_data, - EntityEvent **sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_sample, - void *endpoint_plugin_qos); - - NDDSUSERDllExport extern RTIBool - EntityEventPlugin_deserialize_from_cdr_buffer( - EntityEvent *sample, - const char * buffer, - unsigned int length); - - NDDSUSERDllExport extern unsigned int - EntityEventPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - NDDSUSERDllExport extern PRESTypePluginKeyKind - EntityEventPlugin_get_key_kind(void); - - NDDSUSERDllExport extern unsigned int - EntityEventPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - EntityEventPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern RTIBool - EntityEventPlugin_deserialize_key( - PRESTypePluginEndpointData endpoint_data, - EntityEvent ** sample, - RTIBool * drop_sample, - struct RTICdrStream *cdrStream, - RTIBool deserialize_encapsulation, - RTIBool deserialize_key, - void *endpoint_plugin_qos); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - DistributionTopicKindPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - DistributionTopicKindPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - DistributionTopicKindPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - DistributionTopicKindPluginSupport_print_data( - const DistributionTopicKind *sample, - const char *desc, - unsigned int indent_level); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ResourceKindIndexPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ResourceKindIndexPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ResourceKindIndexPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - ResourceKindIndexPluginSupport_print_data( - const ResourceKindIndex *sample, - const char *desc, - unsigned int indent_level); - - /* ---------------------------------------------------------------------------- - (De)Serialize functions: - * ------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ResourceKindPlugin_get_serialized_sample_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* -------------------------------------------------------------------------------------- - Key Management functions: - * -------------------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern unsigned int - ResourceKindPlugin_get_serialized_key_max_size( - PRESTypePluginEndpointData endpoint_data, - RTIBool include_encapsulation, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - NDDSUSERDllExport extern unsigned int - ResourceKindPlugin_get_serialized_key_max_size_for_keyhash( - PRESTypePluginEndpointData endpoint_data, - RTIEncapsulationId encapsulation_id, - unsigned int current_alignment); - - /* ---------------------------------------------------------------------------- - Support functions: - * ---------------------------------------------------------------------------- */ - - NDDSUSERDllExport extern void - ResourceKindPluginSupport_print_data( - const ResourceKind *sample, - const char *desc, - unsigned int indent_level); - - } /* namespace Monitoring */ - } /* namespace Service */ -} /* namespace RTI */ - -#if defined(NDDS_USER_DLL_EXPORT_ROUTER_SERVICE_COMMON) || defined(NDDS_USER_SYMBOL_EXPORT) -#undef NDDSUSERDllExport -#define NDDSUSERDllExport -#endif - -#endif /* ServiceCommonPlugin_1902811798_h */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/CollectorService.hpp b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/CollectorService.hpp deleted file mode 100644 index 6efb117eb..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/CollectorService.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef RTI_MONITORING_COLLECTOR_SERVICE_HPP_ -#define RTI_MONITORING_COLLECTOR_SERVICE_HPP_ - -#include - -#endif // RTI_MONITORING_COLLECTOR_SERVICE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Dll.h b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Dll.h deleted file mode 100644 index 8a7ec7c98..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Dll.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef monitoringcollector_dll_h -#define monitoringcollector_dll_h - - - -#if defined(RTI_WIN32) || defined(RTI_WINCE) || defined(RTI_INTIME) - #if defined(RTI_collectorservice_DLL_EXPORT) - #define COLLECTORSERVICEDllExport __declspec( dllexport ) - #else - #define COLLECTORSERVICEDllExport - #endif /* RTI_collectorservice_DLL_EXPORT */ - - #if defined(RTI_collectorservice_DLL_VARIABLE) - #if defined(RTI_collectorservice_DLL_EXPORT) - #define COLLECTORSERVICEDllVariable __declspec( dllexport ) - #else - #define COLLECTORSERVICEDllVariable __declspec( dllimport ) - #endif /* RTI_collectorservice_DLL_EXPORT */ - #else - #define COLLECTORSERVICEDllVariable - #endif /* RTI_collectorservice_DLL_VARIABLE */ -#elif defined(RTI_VISIBILITY_HIDDEN) - #define COLLECTORSERVICEDllExport __attribute__((visibility("default"))) - #define COLLECTORSERVICEDllVariable __attribute__((visibility("default"))) -#else - #define COLLECTORSERVICEDllExport - #define COLLECTORSERVICEDllVariable -#endif /* RTI_WIN32 || RTI_WINCE || RTI_INTIME */ - - -#endif /* monitoringcollector_dll_h */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Log.h b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Log.h deleted file mode 100644 index 94fbfe8c4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Log.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef monitoringcollector_log_h -#define monitoringcollector_log_h - - - #ifndef monitoringcollector_dll_h - #include - #endif - #ifndef log_common_h - #include "log/log_common.h" - #endif - #ifdef __cplusplus - extern "C" { - #endif - - - /*i \ingroup COLLECTORSERVICELogModule - Submodule ID for Monitoring Collector Configuration submodule - */ - #define SUBMODULE_COLLECTORSERVICE_CONFIG (0x1000) - - /*i \ingroup COLLECTORSERVICELogModule - Submodule ID for Monitoring Collector service submodule - */ - #define SUBMODULE_COLLECTORSERVICE_SERVICE (0x2000) - - /*i \ingroup COLLECTORSERVICELogModule - Submodule ID for Monitoring Collector Adapters submodule - */ - #define SUBMODULE_COLLECTORSERVICE_ADAPTERS (0x3000) - - /*i \ingroup COLLECTORSERVICELogModule - Submodule ID for Monitoring Collector wrapper application submodule - */ - #define SUBMODULE_COLLECTORSERVICE_APP (0x4000) - - /*i \ingroup COLLECTORSERVICELogModule - Submodule ID for Monitoring Collector processor submodule - */ - #define SUBMODULE_COLLECTORSERVICE_PROCESSORS (0x5000) - - - /*i \ingroup COLLECTORSERVICELogModule - Mask for turning on logging for only the Monitoring Collector Configuration submodule - */ - #define COLLECTORSERVICE_SUBMODULE_MASK_CONFIG (0x0001) - - /*i \ingroup COLLECTORSERVICELogModule - Mask for turning on logging for only the Monitoring Collector Configuration submodule - */ - #define COLLECTORSERVICE_SUBMODULE_MASK_SERVICE (0x0002) - - /*i \ingroup COLLECTORSERVICELogModule - Mask for turning on logging for only the Monitoring Collector Adapters submodule - */ - #define COLLECTORSERVICE_SUBMODULE_MASK_ADAPTERS (0x0004) - - /*i \ingroup COLLECTORSERVICELogModule - Mask for turning on logging for only the Monitoring Collector Application submodule - */ - #define COLLECTORSERVICE_SUBMODULE_MASK_APP (0x0008) - - /*i \ingroup COLLECTORSERVICELogModule - Mask for turning on logging for only the Monitoring Collector Application submodule - */ - #define COLLECTORSERVICE_SUBMODULE_MASK_PROCESSORS (0x000A) - -/*i \ingroup COLLECTORSERVICELogModule - Mask for turning on logging for all submodules - */ - #define COLLECTORSERVICE_SUBMODULE_MASK_ALL RTI_LOG_SUBMODULE_MASK_ALL - - #ifdef __cplusplus - } /* extern "C" */ - #endif - -#endif /* monitoringcollector_log_h */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Logger.hpp b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Logger.hpp deleted file mode 100644 index e1ee2e75f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Logger.hpp +++ /dev/null @@ -1,172 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_MONITORING_COLLECTOR_LOGGER_HPP_ -#define RTI_MONITORING_COLLECTOR_LOGGER_HPP_ - -#include - -#include -#include - - -namespace rti { namespace monitoring { namespace collector { - -/** \ingroup RTI_MonitoringCollectorServiceLibModule - * - * @brief The singleton type used to configure @product verbosity - * - * For configuring other aspects such as output file, print format or - * RTI Connext specific logging, use rti::config::Logger. - * - */ -class Logger { -public: - - typedef rti::config::Verbosity Verbosity; - typedef rti::config::LogCategory LogCategory; - typedef rti::config::PrintFormat PrintFormat; - - static Logger& instance(); - - /** - * @brief Logs as message with EXCEPTION level - * - * The generated log will be part of logging stream of the running service - * if the service verbosity contains EXCEPTION messages. The result log - * message may include additional information according to the - * Connext logging configuration, such as Advlog Context, thread ID, - * line number, etc. Additionally, the result log message will contain a - * newline character at the end, so the format does not need to contain it. - * - * @param[in] msg Message to be logged - */ - void error(const std::string& msg); - - /** - * @brief overload of error(const std::string& msg) - */ - void error(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * WARNING. - * - * @param[in] msg Message to be logged - * - * @see rti::monitoring::collector::Logger::error - * - */ - void warn(const std::string& msg); - - /** - * @brief overload of warn(const std::string& msg) - */ - void warn(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_LOCAL. - * - * @param[in] msg Message to be logged - * - * @see rti::monitoring::collector::Logger::error - * - */ - void local(const std::string& msg); - - /** - * @brief overload of local(const std::string& msg) - */ - void local(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_REMOTE. - * - * @param[in] msg Message to be logged - * - * @see rti::monitoring::collector::Logger::error - * - */ - void remote(const std::string& msg); - - /** - * @brief overload of remote(const std::string& msg) - */ - void remote(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_DEBUG. - * - * @param[in] msg Message to be logged - * - * @see rti::monitoring::collector::Logger::error - * - */ - void debug(const std::string& msg); - - /** - * @brief overload of debug(const std::string& msg) - */ - void debug(const char *msg); - - /** - * @brief Sets the verbosity for the log messages generated at the - * @product level. - * - * @param[in] verbosity - * The verbosity of the service logs - */ - void service_verbosity(rti::config::Verbosity verbosity); - - /** - * @brief Getter for the same attribute - * - * @see verbosity(rti::config::Verbosity) - */ - rti::config::Verbosity service_verbosity(); - - /** - * @deprecated - * @see service_verbosity - */ - void verbosity(rti::config::Verbosity verbosity); - - /** - * @deprecated - * @see service_verbosity - */ - rti::config::Verbosity verbosity(); - - virtual ~Logger(); - -private: - - void message(const rti::config::LogLevel& level, const char* msg); - - Logger(); - - // Disable copy - Logger(const Logger&); - Logger& operator=(const Logger&); -}; - -} } } - -#endif // RTI_MONITORING_COLLECTOR_LOGGER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/PropertySet.hpp b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/PropertySet.hpp deleted file mode 100644 index 21cc855f8..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/PropertySet.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef RTI_COLLECTOR_PROPERTYSET_HPP -#define RTI_COLLECTOR_PROPERTYSET_HPP - -#include - -namespace rti { namespace monitoring { namespace collector { - -typedef rti::routing::PropertySet PropertySet; - -} } } - -#endif /* RTI_COLLECTOR_PROPERTYSET_HPP */ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Service.hpp b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Service.hpp deleted file mode 100644 index 424250f75..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/Service.hpp +++ /dev/null @@ -1,209 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_COLLECTOR_SERVICE_HPP_ -#define RTI_COLLECTOR_SERVICE_HPP_ - -#include -#include - -#include -#include -#include - -namespace rti { namespace monitoring { namespace collector { - -/*e \defgroup RTI_CollectorServiceLibModule RTI Monitoring Collector API - * - * @brief @product can be deployed as a native library linked into your - * application in select architectures. - * - * This API allows you to create, configure and start @product instances from - * your application. - * - * The following code shows the typical use of the API: - * - * \code - * - * int main () - * { - * rti::monitoring::collector::Service service( - * rti::monitoring::collector::ServiceProperty() - * .cfg_file("MyCollectorService.xml") - * .service_name("MyCollectorService")); - * ... - * - * service.start(); - * - * while(keep_running) { - * sleep(); - * ... - * } - * - * return 0; - * } - * - * \endcode - * - * Instead of a file, you can use XML strings to configure @product. - * See ServiceProperty for more information. - *

- * To build your application you need to link with the @product native library - * in <@ndds home>/bin/<architecture>/ . - * - * ### Development Requirements - * - * | | Linux Systems | Windows Systems | - * | --------------: | :----------------: | :-------------: | - * | Shared Libraries| libnddscpp2.so | nddscpp2.dll | - * | Shared Libraries| librtiroutingservice.so | rtiroutingservice.dll | - * | ^ | librtirsinfrastructure.so | rtirsinfrastructure.dll | - * | ^ | librticollectorservice.so | rticollectorservice.dll | - * | ^ | librtidlc.so | rtidlc.dll | - * | ^ | libnddsmetp.so | nddsmetp.dll | - * | ^ | libnddsc.so | nddsc.dll | - * | ^ | librtixml2.so | rtixml2.dll | - * | ^ | libnddscore.so | nddscore.dll | - * | Headers | rti/monitoring/collector/RecordingService.hpp || - * - */ - -/** \ingroup RTI_CollectorServiceLibModule - * - * @brief The @product. - * - */ -class Service : public dds::core::Reference { -public: - - typedef dds::core::Reference Base; - OMG_DDS_REF_TYPE_NOTYPENAME( - Service, - dds::core::Reference, - ServiceImpl); - - /** - * @brief Creates a @product instance - * - * @param[in] property - * The property to configure @product instance. - * - * @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks): - * UNSAFE for multiple threads to simultaneously make the FIRST - * call to any of the Service constructors. Subsequent calls are - * thread safe. - * On Windows and Linux systems, these calls are thread-safe. - */ - explicit Service(const ServiceProperty& property) - : Base(new ServiceImpl(property)) - { - this->delegate()->remember_reference(this->delegate()); - } - - /** - * @brief Creates a @product instance - * - * A callable shutdown hook can optionally be provided to handle the - * shutdown command received through remote administration. Upon reception - * of this command, @product will notify the installed hook. - * - * The following example shows simple implementation of a shutdown hook - * that sets a boolean flag to true when invoked: - * - * \code - * - * // Hook implmentation - * struct FlagShutdownHook { - * public: - * FlagShutdownHook(bool& the_flag) : flag(the_flag) - * { - * flag = false; - * } - * void operator()() { - * the_flag = true; - * } - * - * bool& flag; - * }; - * - * // Instantiate service with hook - * bool my_flag; - * rti::monitoring::collector::Service collector_service_instance( - * property, - * FlagShutdownHook(my_flag)); - * ... - * - * - * \endcode - * - * @param[in] property - * The property to configure @product instance. - * - * @param[in] shutdown_hook - * Callable object to handle the shutdown command. The expected - * type is a void operator()() (C++11 equivalent is - * std::function) - * - * @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks): - * UNSAFE for multiple threads to simultaneously make the FIRST - * call to any of the Service constructors. Subsequent calls are - * thread safe. - * On Windows and Linux systems, these calls are thread-safe. - */ - template - explicit Service( - const ServiceProperty& property, - const HookFunc& shutdown_hook) - : Base(new ServiceImpl( - property, - new rti::routing::detail::ShutdownHookForwarder( - shutdown_hook))) - { - this->delegate()->remember_reference(this->delegate()); - } - - - explicit Service(Base::DELEGATE_REF_T reference) : Base(reference) - { - if (this->delegate()) { - this->delegate()->remember_reference(this->delegate()); - } - } - - virtual ~Service() = default; - - /** - * @brief Starts @product. - * - * This is a non-blocking operation. @product will create its own set of - * threads to perform its tasks. - */ - void start() - { - this->delegate()->start(); - } - - /** - * @brief Stops @product. - * - * This operation will bloc the instance is fully stopped. - */ - void stop() - { - this->delegate()->stop(); - } - -}; - - -typedef Service CollectorService; - -} } } - -#endif // RTI_COLLECTOR_SERVICE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/ServiceProperty.hpp b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/ServiceProperty.hpp deleted file mode 100644 index 0c08e7077..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/ServiceProperty.hpp +++ /dev/null @@ -1,316 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_SERVICEPROPERTY_HPP_ -#define HPP_SERVICE_SERVICEPROPERTY_HPP_ - -#include -#include -#include -#include -#include - -#include "osapi/osapi_type.h" - -#include "routingservice/routingservice_infrastructure.h" -#include "routingservice/routingservice_service.h" - -#include -#include - -namespace rti { namespace monitoring { namespace collector { - - -typedef rti::routing::PropertySet PropertySet; - -/** \ingroup RTI_MonitoringCollectorLibModule - * - * @brief Configuration for a @product object. - * - */ -class ServiceProperty { -public: - /** - * @brief Creates a property object with default settings. - */ - ServiceProperty() : - cfg_file_(""), - service_name_(""), - application_name_(""), - domain_id_base_(0), - enable_service_monitoring_(false), - service_monitoring_domain_id_(0), - enforce_xsd_validation_(true), - ignore_default_files_(false) - { - - } - - static ServiceProperty default_property() - { - ServiceProperty default_property; - default_property.service_name("default"); - return default_property; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string& cfg_file() const - { - return cfg_file_; - } - - /** - * @brief Path to an @product configuration file - * - * @default empty string. - */ - ServiceProperty& cfg_file(const std::string & cfg_file) - { - cfg_file_ = cfg_file; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string & service_name() const - { - return service_name_; - } - - /** - * @brief The name of the @product configuration to run. - * - * This is the name used to find the service XML tag in the configuration - * file; the name that will be used to refer to this execution in remote - * administration and - * monitoring. - * - * @default empty string. - */ - ServiceProperty& service_name(const std::string & service_name) - { - service_name_ = service_name; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string & application_name() const - { - return application_name_; - } - - /** - * @brief Assigns a name to the execution of the @product. - * - * Remote commands and status information will refer to the service using - * this name. - * - * In addition, the name of DomainParticipants created by @product will be - * based on this name. - * - * @default empty string. - * If no application name is specified, @product will use - * ServiceProperty::service_name. - * - */ - ServiceProperty& application_name(const std::string & application_name) - { - application_name_ = application_name; - - return *this; - } - - - /** - * @brief Getter (see setter with the same name) - */ - int32_t domain_id_base() const - { - return domain_id_base_; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enforce_xsd_validation() const - { - return enforce_xsd_validation_; - } - - /** - * @brief Controls whether the service applies XSD validation to the loaded - * configuration. - * - * @default true - */ - ServiceProperty& enforce_xsd_validation(bool enforce) - { - enforce_xsd_validation_ = enforce; - - return *this; - } - - /** - * @brief Value that is added to the domain IDs of the - * domain routes in the XML configuration. - * - * By using this, an XML file can use relative domain IDs. - * - * @default 0 - */ - ServiceProperty& domain_id_base(int32_t domain_id) - { - domain_id_base_ = domain_id; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enable_service_monitoring() const - { - return enable_service_monitoring_; - } - - /** - * @brief Set it to true to enable remote monitoring - * or false to disable it. - * - * @default false - */ - ServiceProperty& enable_service_monitoring(bool enable_monitoring) - { - enable_service_monitoring_ = enable_monitoring; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int32_t service_monitoring_domain_id() const - { - return service_monitoring_domain_id_; - } - - /** - * @brief If ServiceProperty::enable_monitoring is true, this is - * the domain ID to use for remote monitoring. - * - * Takes precedence over the XML configuration. - * If ServiceProperty::enable_monitoring is false, this value is not used, - * even if remote monitoring is enabled in the XML configuration. - * - * @default 0 - */ - ServiceProperty& service_monitoring_domain_id(int32_t domain_id) - { - service_monitoring_domain_id_ = domain_id; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool ignore_default_files() const - { - return ignore_default_files_; - } - - /** - * @brief Set it to true to avoid loading the - * standard files usually loaded by @product. - * - * Only the configuration in ServiceProperty::cfg_file or - * ServiceProperty::cfg_strings will be loaded. - * - * @default false - */ - ServiceProperty& ignore_default_files(bool ignore) - { - ignore_default_files_ = ignore; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string& license_file() const - { - return license_file_; - } - - /** - * @brief Path to an RTI Connext license file. This parameter is only used - * if your installation requires a license file. - * - * @default empty string. - */ - ServiceProperty& license_file(const std::string& license_file) - { - license_file_ = license_file; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const PropertySet& user_environment() const - { - return user_env_; - } - - /** - * @brief Non-const getter for modification that can be used to add - * elements individually. (see setter with the same name) - */ - PropertySet& user_environment() - { - return user_env_; - } - - /** - * @brief Dictionary of user variables. - * The dictionary provides a parallel way to expand XML configuration - * variables in the form $(my_var), when they are not defined in the - * environment. - * - * @default empty - */ - ServiceProperty& user_environment(const PropertySet& user_environment) - { - user_env_ = user_environment; - - return *this; - } - -private: - std::string cfg_file_; - std::string service_name_; - std::string application_name_; - int32_t domain_id_base_; - bool enable_service_monitoring_; - int32_t service_monitoring_domain_id_; - bool enforce_xsd_validation_; - bool ignore_default_files_; - std::string license_file_; - PropertySet user_env_; -}; - - -} } } /* namespace rti::monitoring::collector */ - -#endif /* HPP_SERVICE_SERVICEPROPERTY_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/detail/CollectorServiceImpl.hpp b/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/detail/CollectorServiceImpl.hpp deleted file mode 100644 index acb0ccdee..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/monitoring/collector/detail/CollectorServiceImpl.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_MONITORING_COLLECTOR_SERVICE_IMPL_HPP_ -#define RTI_MONITORING_COLLECTOR_SERVICE_IMPL_HPP_ - -#include - -#include -#include -#include -#include - -namespace rti { namespace monitoring { namespace collector { - -namespace service { -class Service; -} - -namespace detail { - -typedef rti::routing::detail::AbstractShutdownHookForwarder - AbstractShutdownHookForwarder; - -} - -class Application; - -// class COLLECTORSERVICEDllExport ServiceImpl -class COLLECTORSERVICEDllExport ServiceImpl - : public rti::core::detail::RetainableType { -public: - - explicit ServiceImpl(const ServiceProperty& property); - - ServiceImpl( - const ServiceProperty& property, - detail::AbstractShutdownHookForwarder *hook_forwarder); - - virtual ~ServiceImpl(); - - void start(); - - void stop(); - -private: - - friend class rti::monitoring::collector::Application; - - rti::monitoring::collector::service::Service *impl_; - - detail::AbstractShutdownHookForwarder *shutdown_forwarder_fwd_; -}; - -} } } - -#endif // RTI_MONITORING_COLLECTOR_SERVICE_IMPL_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/Logger.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/Logger.hpp deleted file mode 100644 index 941acf940..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/Logger.hpp +++ /dev/null @@ -1,174 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_LOGGER_HPP_ -#define RTI_RECORDING_LOGGER_HPP_ - -#include "recordingservice/recordingservice_dll.h" - -#include -#include - - -namespace rti { namespace recording { - -/** \ingroup RTI_RecordingServiceLibModule - * - * @brief The singleton type used to configure @product verbosity - * - * For configuring other aspects such as output file, print format or - * RTI Connext specific logging, use rti::config::Logger. - * - */ -class RECORDERDllExport Logger -{ -public: - - typedef rti::config::Verbosity Verbosity; - typedef rti::config::LogCategory LogCategory; - typedef rti::config::PrintFormat PrintFormat; - - static Logger& instance(); - - /** - * @brief Logs as message with EXCEPTION level - * - * The generated log will be part of logging stream of the running service - * if the service verbosity contains EXCEPTION messages. The result log - * message may include additional information according to the - * Connext logging configuration, such as Advlog Context, thread ID, - * line number, etc. Additionally, the result log message will contain a - * newline character at the end, so the format does not need to contain it. - * - * @param[in] msg Message to be logged - */ - void error(const std::string& msg); - - /** - * @brief overload of error(const std::string& msg) - */ - void error(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * WARNING. - * - * @param[in] msg Message to be logged - * - * @see rti::recording::Logger::error - * - */ - void warn(const std::string& msg); - - /** - * @brief overload of warn(const std::string& msg) - */ - void warn(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_LOCAL. - * - * @param[in] msg Message to be logged - * - * @see rti::recording::Logger::error - * - */ - void local(const std::string& msg); - - /** - * @brief overload of local(const std::string& msg) - */ - void local(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_REMOTE. - * - * @param[in] msg Message to be logged - * - * @see rti::recording::Logger::error - * - */ - void remote(const std::string& msg); - - /** - * @brief overload of remote(const std::string& msg) - */ - void remote(const char *msg); - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_DEBUG. - * - * @param[in] msg Message to be logged - * - * @see rti::recording::Logger::error - * - */ - void debug(const std::string& msg); - - /** - * @brief overload of debug(const std::string& msg) - */ - void debug(const char *msg); - - /** - * @brief Sets the verbosity for the log messages generated at the - * @product level. - * - * @param[in] verbosity - * The verbosity of the service logs - */ - void service_verbosity(rti::config::Verbosity verbosity); - - /** - * @brief Getter for the same attribute - * - * @see verbosity(rti::config::Verbosity) - */ - rti::config::Verbosity service_verbosity(); - - /** - * @deprecated - * @see service_verbosity - */ - void verbosity(rti::config::Verbosity verbosity); - - /** - * @deprecated - * @see service_verbosity - */ - rti::config::Verbosity verbosity(); - - virtual ~Logger(); - -private: - - void message(const rti::config::LogLevel& level, const char* msg); - - Logger(); - - // Disable copy - Logger(const Logger&); - Logger& operator=(const Logger&); -}; - -}} - -#endif // RTI_RECORDING_LOGGER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/PropertySet.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/PropertySet.hpp deleted file mode 100644 index 8fd4465b1..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/PropertySet.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef RTI_RECORDING_PROPERTYSET_HPP -#define RTI_RECORDING_PROPERTYSET_HPP - -#include - -namespace rti { namespace recording { - -typedef rti::routing::PropertySet PropertySet; - -}} - -#endif /* RTI_RECORDING_PROPERTYSET_HPP */ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/RecordingService.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/RecordingService.hpp deleted file mode 100644 index afc45c78a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/RecordingService.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef RTI_RECORDING_RECORDING_SERVICE_HPP_ -#define RTI_RECORDING_RECORDING_SERVICE_HPP_ - -#include - -#endif diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/Service.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/Service.hpp deleted file mode 100644 index 14917b1bf..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/Service.hpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_SERVICE_HPP_ -#define RTI_RECORDING_SERVICE_HPP_ - -#include -#include - -#include -#include -#include - -namespace rti { namespace recording { - -/*e \defgroup RTI_RecordingServiceLibModule RTI Recording Library API - * - * @brief @product can be deployed as a native library linked into your - * application in select architectures. - * - * This API allows you to create, configure and start @product instances from - * your application. - * - * The following code shows the typical use of the API: - * - * \code - * - * int main () - * { - * rti::recording::Service service( - * rti::recording::ServiceProperty() - * .cfg_file("MyRecorder.xml") - * .service_name("MyRecorder")); - * ... - * - * service.start(); - * - * while(keep_running) { - * sleep(); - * ... - * } - * - * return 0; - * } - * - * \endcode - * - * Instead of a file, you can use XML strings to configure @product. - * See ServiceProperty for more information. - *

- * To build your application you need to link with the @product native library - * in <@ndds home>/bin/<architecture>/ . - * - * ### Development Requirements - * - * | | Linux Systems | Windows Systems | - * | --------------: | :----------------: | :-------------: | - * | Shared Libraries| libnddscpp2.so | nddscpp2.dll | - * | Shared Libraries| librtiroutingservice.so | rtiroutingservice.dll | - * | ^ | librtirsinfrastructure.so | rtirsinfrastructure.dll | - * | ^ | librtirecordingservicecore.so | rtirecordingservicecore.dll | - * | ^ | librtidlc.so | rtidlc.dll | - * | ^ | libnddsmetp.so | nddsmetp.dll | - * | ^ | libnddsc.so | nddsc.dll | - * | ^ | librtixml2.so | rtixml2.dll | - * | ^ | libnddscore.so | nddscore.dll | - * | Headers | rti/recording/RecordingService.hpp || - * - */ - -/** \ingroup RTI_RecordingServiceLibModule - * - * @brief The @product. - * - */ -class Service : public dds::core::Reference { -public: - typedef RTI::Service::Admin::CommandRequest CommandRequest; - typedef RTI::Service::Admin::CommandReply CommandReply; - - typedef dds::core::Reference Base; - OMG_DDS_REF_TYPE_NOTYPENAME( - Service, - dds::core::Reference, - RecordingServiceImpl); - - /** - * @brief Creates a @product instance - * - * @param[in] property - * The property to configure @product instance. - * - * @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks): - * UNSAFE for multiple threads to simultaneously make the FIRST - * call to any of the Service constructors. Subsequent calls are - * thread safe. - * On Windows and Linux systems, these calls are thread-safe. - */ - explicit Service(const ServiceProperty& property) - : Base(new RecordingServiceImpl(property)) - { - this->delegate()->remember_reference(this->delegate()); - } - - /** - * @brief Creates a @product instance - * - * A callable shutdown hook can optionally be provided to handle the - * shutdown command received through remote administration or upon execution - * termination in the case of the REPLAY role. Upon reception - * of this command, @product will notify the installed hook. - * - * The following example shows simple implementation of a shutdown hook - * that sets a boolean flag to true when invoked: - * - * \code - * - * // Hook implementation - * struct FlagShutdownHook { - * public: - * FlagShutdownHook(bool& the_flag) : flag(the_flag) { - * flag = false; - * } - * void operator()() { - * flag = true; - * } - * - * bool& flag; - * }; - * - * // Instantiate service with hook - * bool my_flag; - * rti::recording::Service recording_service( - * property, - * FlagShutdownHook(my_flag)); - * ... - * - * - * \endcode - * - * @param[in] property - * The property to configure @product instance. - * - * @param[in] shutdown_hook - * Callable object to handle the shutdown command. The expected - * type is a void operator()() (C++11 equivalent is - * std::function) - * - * @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks): - * UNSAFE for multiple threads to simultaneously make the FIRST - * call to any of the Service constructors. Subsequent calls are - * thread safe. - * On Windows and Linux systems, these calls are thread-safe. - */ - template - explicit Service( - const ServiceProperty& property, - HookFunc& shutdown_hook) - : Base(new RecordingServiceImpl( - property, - new rti::routing::detail::ShutdownHookForwarder( - shutdown_hook))) - { - this->delegate()->remember_reference(this->delegate()); - } - - - explicit Service(Base::DELEGATE_REF_T reference) : Base(reference) - { - if (this->delegate()) { - this->delegate()->remember_reference(this->delegate()); - } - } - - /** - * @brief Starts @product. - * - * This is a non-blocking operation. @product will create its own set of - * threads to perform its tasks. - */ - void start() - { - this->delegate()->start(); - } - - /** - * @brief Stops @product. - * - * This operation will bloc the instance is fully stopped. - */ - void stop() - { - this->delegate()->stop(); - } - - - - /** - * @brief Executes an Administration command on this service. - * - * This operation directly executes the specified \p request in this - * service as if it was directly received from an administration requester. - * - * The request can represent any of the available administration operations - * as documented in the Administration chapter in the user's manual. This - * operation gives you an alternative way to control the service using - * the same remote administration interface but allowing you to call - * the operation directly. - * - * This operation can also throw an exception if an internal error - * occurs. - * - * Example: - * - * \code - * - * using namespace rti::recording; - * using namespace RTI::Service; - * using namespace RTI::Service::Admin; - * - * // Instantiate a RecordingService - * RecordingService service(...); - * - * // Prepare a request for any command, for example stop the service - * CommandRequest request; - * request.action(CommandActionKind::UPDATE_ACTION); - * request.resource_identifier("/recording_services/MyRecorder"); - * dds::topic::topic_type_support::to_cdr_buffer( - * reinterpret_cast &>(request.octet_body()), - * EntityState(EntityStateKind::DISABLED)); - * // Execute and check result - * CommandReply reply = service.execute_command(request); - * if (reply.retcode().underlying() != CommandReplyRetcode::OK_RETCODE) { - * Logger.instance().error( - * std::string("Command returned: ") + reply.string_body()); - * //handle - * ... - * } - * - * \endcode - * - * @param[in] request Representation of the command to be executed - * @return The reply with the result of the command execution. - * - */ - CommandReply execute_command(const CommandRequest& request) - { - return this->delegate()->execute_command(request); - } - - /** - * @brief Executes an Administration command on this service. - * - * Similar to execute_command(const CommandRequest& request) except - * the caller provides the CommandReply object. - * - * @param[out] reply Representation of the reply containing the result of - * the operation - * @param[in] request Representation of the command to be executed - * - * @return A reference to the same reply object provided as a parameter - */ - CommandReply& execute_command( - CommandReply& reply, - const CommandRequest& request) - { - return this->delegate()->execute_command(reply, request); - } - - /** - * @deprecated Calling this function at the end of the application is no - * longer necessary. It will be removed in future versions. - */ - static void finalize_globals() - { - rti::recording::Logger::instance().warn( - "Calling 'rti::recording::Service::finalize_globals()' is no " - "longer necessary and the function will be removed in future " - "versions"); - } -}; - - -typedef Service RecordingService; - -}} - -#endif // RTI_RECORDING_SERVICE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/ServiceProperty.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/ServiceProperty.hpp deleted file mode 100644 index 9551ff786..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/ServiceProperty.hpp +++ /dev/null @@ -1,579 +0,0 @@ -/* - * $Id$ - * - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_SERVICE_SERVICEPROPERTY_HPP_ -#define HPP_SERVICE_SERVICEPROPERTY_HPP_ - -#include "stdio.h" -#include "stdlib.h" -#include -#include -#include - -#include "osapi/osapi_type.h" - -#include "routingservice/routingservice_infrastructure.h" -#include "routingservice/routingservice_service.h" - -#include -#include - -namespace rti { namespace recording { - -/** \ingroup RTI_RecordingServiceLibModule - * - * The definition of the rti::recording::ApplicationRoleKind - * - * It indicates the operation mode of @product. - */ -struct ApplicationRoleKind_def { - /** - * @brief The underlying \p enum type - */ - enum type { - /** - * @brief Record mode - */ - RECORD_APPLICATION, - /** - * @brief Replay mode - */ - REPLAY_APPLICATION, - /** - * @brief Converter mode - */ - CONVERTER_APPLICATION, - /*i - * @brief Internal use only - */ - XML_CONVERTER_APPLICATION, - /*i - * @brief Indexer mode. To be used internally by our command-line tool. - */ - INDEX_APPLICATION, - /*i - */ - count_ - }; -}; - -typedef dds::core::safe_enum ApplicationRoleKind; - -/*i - * @brief Internal use only - */ -struct XmlConverterRoleKind_def { - - enum type { - RECORD_CONVERT, - REPLAY_CONVERT, - count_ - }; -}; - -typedef dds::core::safe_enum XmlConverterRoleKind; - -/*i - * @brief Indexer mode enumeration, used by the index application (offline - * indexing) - */ -struct IndexerModeKind_def { - - enum type { - INSTANCE_INDEXING, - SQLITE_INDEXING, - count_ - }; -}; -typedef dds::core::safe_enum IndexerModeKind; - -typedef rti::routing::PropertySet PropertySet; - -/** \ingroup RTI_RecordingServiceLibModule - * - * @brief Configuration for a @product object. - * - */ -class ServiceProperty { -public: - /** - * @brief Creates a property object with default settings. - */ - ServiceProperty() : - cfg_file_(""), - service_name_(""), - application_name_(""), - domain_id_base_(0), - enable_administration_(false), - administration_domain_id_(0), - enable_monitoring_(false), - monitoring_domain_id_(0), - application_role_(ApplicationRoleKind::RECORD_APPLICATION), - enforce_xsd_validation_(true), - ignore_default_files_(false), - output_cfg_file_(""), - debug_mode_(false), - reverse_mode_(false), - xml_converter_role_(XmlConverterRoleKind::RECORD_CONVERT), - indexer_mode_(IndexerModeKind::INSTANCE_INDEXING), - user_env_() - - { - - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string& cfg_file() const - { - return cfg_file_; - } - - /** - * @brief Path to an @product configuration file - * - * @default empty string. - */ - ServiceProperty& cfg_file(const std::string & cfg_file) - { - cfg_file_ = cfg_file; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string & service_name() const - { - return service_name_; - } - - /** - * @brief The name of the @product configuration to run. - * - * This is the name used to find the service XML tag in the configuration - * file; the name that will be used to refer to this execution in remote - * administration and - * monitoring. - * - * @default empty string. - */ - ServiceProperty& service_name(const std::string & service_name) - { - service_name_ = service_name; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string & application_name() const - { - return application_name_; - } - - /** - * @brief Assigns a name to the execution of the @product. - * - * Remote commands and status information will refer to the service using - * this name. - * - * In addition, the name of DomainParticipants created by @product will be - * based on this name. - * - * @default empty string. - * If no application name is specified, @product will use - * ServiceProperty::service_name. - * - */ - ServiceProperty& application_name(const std::string & application_name) - { - application_name_ = application_name; - - return *this; - } - - - /** - * @brief Getter (see setter with the same name) - */ - int32_t domain_id_base() const - { - return domain_id_base_; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enforce_xsd_validation() const - { - return enforce_xsd_validation_; - } - - /** - * @brief Controls whether the service applies XSD validation to the loaded - * configuration. - * - * @default true - */ - ServiceProperty& enforce_xsd_validation(bool enforce) - { - enforce_xsd_validation_ = enforce; - - return *this; - } - - /** - * @brief Value that is added to the domain IDs of the - * domain routes in the XML configuration. - * - * By using this, an XML file can use relative domain IDs. - * - * @default 0 - */ - ServiceProperty& domain_id_base(int32_t domain_id) - { - domain_id_base_ = domain_id; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enable_administration() const - { - return enable_administration_; - } - - /** - * @brief Set this to true to enable remote administration - * or false to disable it. - * - * @default false - */ - ServiceProperty& enable_administration(bool enable_administration) - { - enable_administration_ = enable_administration; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int32_t administration_domain_id() const - { - return administration_domain_id_; - } - - /** - * @brief If ServiceProperty::enable_administration is true, this is - * the domain ID to use for remote administration. - * - * Takes precedence over the XML configuration. - * If ServiceProperty::enable_administration is false, this value is not used - * even if remote administration is enabled in the XML configuration. - * - * @default 0 - */ - ServiceProperty& administration_domain_id(int32_t domain_id) - { - administration_domain_id_ = domain_id; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enable_monitoring() const - { - return enable_monitoring_; - } - - /** - * @brief Set it to true to enable remote monitoring - * or false to disable it. - * - * @default false - */ - ServiceProperty& enable_monitoring(bool enable_monitoring) - { - enable_monitoring_ = enable_monitoring; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int32_t monitoring_domain_id() const - { - return monitoring_domain_id_; - } - - /** - * @brief If ServiceProperty::enable_monitoring is true, this is - * the domain ID to use for remote monitoring. - * - * Takes precedence over the XML configuration. - * If ServiceProperty::enable_monitoring is false, this value is not used, - * even if remote monitoring is enabled in the XML configuration. - * - * @default 0 - */ - ServiceProperty& monitoring_domain_id(int32_t domain_id) - { - monitoring_domain_id_ = domain_id; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const ApplicationRoleKind& application_role() const - { - return application_role_; - } - - /** - * @brief Selects the operation mode of the service - * - * @see ApplicationRoleKind - */ - ServiceProperty& application_role(ApplicationRoleKind application_role) - { - application_role_ = application_role; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool ignore_default_files() const - { - return ignore_default_files_; - } - - /** - * @brief Set it to true to avoid loading the - * standard files usually loaded by @product. - * - * Only the configuration in ServiceProperty::cfg_file or - * ServiceProperty::cfg_strings will be loaded. - * - * @default false - */ - ServiceProperty& ignore_default_files(bool ignore) - { - ignore_default_files_ = ignore; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::string& license_file() const - { - return license_file_; - } - - /** - * @brief Path to an RTI Connext license file. This parameter is only used - * if your installation requires a license file. - * - * @default empty string. - */ - ServiceProperty& license_file(const std::string& license_file) - { - license_file_ = license_file; - return *this; - } - - /*i - * @brief Internal use only - */ - const std::string output_cfg_file() const - { - return output_cfg_file_; - } - - /*i - * @brief Internal use only - */ - ServiceProperty& output_cfg_file( - const std::string & output_cfg_file) - { - output_cfg_file_ = output_cfg_file; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool debug_mode() const - { - return debug_mode_; - } - - /** - * @brief Set this to true to enable debug mode - * or false to disable it. - * - * @default false - */ - ServiceProperty& debug_mode(bool debug_mode) - { - debug_mode_ = debug_mode; - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool reverse_mode() const - { - return reverse_mode_; - } - - /** - * @brief Set this to true to enable reverse mode - * or false to disable it. - * - * @default false - */ - ServiceProperty& reverse_mode(bool reverse_mode) - { - reverse_mode_ = reverse_mode; - - return *this; - } - - /*i - * @brief Internal use only - */ - XmlConverterRoleKind xml_converter_role() const - { - return xml_converter_role_; - } - - /*i - * @brief Internal use only - */ - ServiceProperty& xml_converter_role( - const XmlConverterRoleKind & xml_converter_role) - { - xml_converter_role_ = xml_converter_role; - return *this; - } - - /*i - * @brief The indexer application mode. Defined by the IndexerModeKind. - * Internal use only - */ - IndexerModeKind indexer_mode() const - { - return indexer_mode_; - } - - /*i - * @brief Set the indexer application mode. Defined by the IndexerModeKind. - * Internal use only - */ - ServiceProperty& indexer_mode(const IndexerModeKind& indexer_mode) - { - indexer_mode_ = indexer_mode; - return *this; - } - - /*i - * @brief The indexer database directory. - * Internal use only - */ - const std::string& db_directory() const - { - return db_directory_; - } - - /*i - * @brief Set the indexer database directory. - * Internal use only - */ - ServiceProperty& db_directory(const std::string& db_directory) - { - db_directory_ = db_directory; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const PropertySet& user_environment() const - { - return user_env_; - } - - /** - * @brief Non-const getter for modification that can be used to add - * elements individually. (see setter with the same name) - */ - PropertySet& user_environment() - { - return user_env_; - } - - /** - * @brief Dictionary of user variables. - * The dictionary provides a parallel way to expand XML configuration - * variables in the form $(my_var), when they are not defined in the - * environment. - * - * @default empty - */ - ServiceProperty& user_environment(const PropertySet& user_environment) - { - user_env_ = user_environment; - - return *this; - } - -private: - std::string cfg_file_; - //std::string cfg_strings[] ? - std::string service_name_; - std::string application_name_; - int32_t domain_id_base_; - bool enable_administration_; - int32_t administration_domain_id_; - bool enable_monitoring_; - int32_t monitoring_domain_id_; - ApplicationRoleKind application_role_; - bool enforce_xsd_validation_; - bool ignore_default_files_; - std::string license_file_; - // Specific to XML conversion - std::string output_cfg_file_; - bool debug_mode_; - bool reverse_mode_; - XmlConverterRoleKind xml_converter_role_; - IndexerModeKind indexer_mode_; - std::string db_directory_; - PropertySet user_env_; -}; - - -} } /* namespace rti::recording */ - -#endif /* HPP_SERVICE_SERVICEPROPERTY_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/StreamInfo.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/StreamInfo.hpp deleted file mode 100644 index cdb874e37..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/StreamInfo.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef RTI_RECORDING_STREAM_INFO_HPP_ -#define RTI_RECORDING_STREAM_INFO_HPP_ - -#include - -namespace rti { namespace recording { - -typedef rti::routing::StreamInfo StreamInfo; - -}} - -#endif /* RTI_RECORDING_STREAM_INFO_HPP_ */ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/detail/RecordingServiceImpl.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/detail/RecordingServiceImpl.hpp deleted file mode 100644 index e538a6890..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/detail/RecordingServiceImpl.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_RECORDING_SERVICE_IMPL_HPP_ -#define RTI_RECORDING_RECORDING_SERVICE_IMPL_HPP_ - -#include "recordingservice/recordingservice_dll.h" - -#include -#include -#include -#include -#include - -namespace rti { namespace recording { - -namespace service { -class Service; -} - -namespace detail { - -typedef rti::routing::detail::AbstractShutdownHookForwarder - AbstractShutdownHookForwarder; - -} - -class Application; - -class RECORDERDllExport RecordingServiceImpl - : public rti::core::detail::RetainableType { - -public: - typedef RTI::Service::Admin::CommandRequest CommandRequest; - typedef RTI::Service::Admin::CommandReply CommandReply; - - explicit RecordingServiceImpl(const ServiceProperty& property); - - RecordingServiceImpl( - const ServiceProperty& property, - detail::AbstractShutdownHookForwarder *hook_forwarder); - - ~RecordingServiceImpl(); - - void start(); - - void stop(); - - CommandReply execute_command(const CommandRequest& request); - - CommandReply& execute_command( - CommandReply& reply, - const CommandRequest& request); - -private: - - friend class rti::recording::Application; - - rti::recording::service::Service *impl_; - detail::AbstractShutdownHookForwarder *shutdown_forwarder_fwd_; -}; - -}} - -#endif // RTI_RECORDING_RECORDING_SERVICE_IMPL_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/EStorageFormat.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/EStorageFormat.hpp deleted file mode 100644 index f1af06e6e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/EStorageFormat.hpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_RTI_RECORDING_STORAGE_ESTORAGEFORMAT_HPP_ -#define HPP_RTI_RECORDING_STORAGE_ESTORAGEFORMAT_HPP_ - -#include - -#include "reda/reda_string.h" -#include "dds_c/dds_c_infrastructure.h" - -#include "dds/core/Exception.hpp" - -namespace rti { namespace recording { namespace storage { - -class EStorageFormat { -public: - - static const DDS_DataRepresentationId_t INVALID_REPRESENTATION = - static_cast( - RTI_CDR_ENCAPSULATION_ID_INVALID); - - static const EStorageFormat XCDR() { - static const EStorageFormat XCDR( - 0, - "XCDR", - DDS_XCDR_DATA_REPRESENTATION); - return XCDR; - } - static const EStorageFormat XCDR2() { - static const EStorageFormat XCDR2( - 1, - "XCDR2", - DDS_XCDR2_DATA_REPRESENTATION); - return XCDR2; - } - static const EStorageFormat XCDR_AUTO() { - static const EStorageFormat XCDR_AUTO( - 2, - "XCDR_AUTO", - DDS_AUTO_DATA_REPRESENTATION); - return XCDR_AUTO; - } - static const EStorageFormat JSON_SQLITE() { - static const EStorageFormat JSON_SQLITE( - 3, - "JSON_SQLITE", - INVALID_REPRESENTATION); - return JSON_SQLITE; - } - /** - * This format is only used by the legacy DB plugins, for the moment. - */ - static const EStorageFormat DESERIALIZED() { - static const EStorageFormat DESERIALIZED( - 4, - "DESERIALIZED", - INVALID_REPRESENTATION); - return DESERIALIZED; - } - - static EStorageFormat from_string_ignore_case(const std::string& value) - { - if (REDAString_iCompare( - value.c_str(), - XCDR().enum_value().c_str()) == 0) { - return XCDR(); - } else if (REDAString_iCompare( - value.c_str(), - XCDR2().enum_value().c_str()) == 0) { - return XCDR2(); - } else if (REDAString_iCompare( - value.c_str(), - XCDR_AUTO().enum_value().c_str()) == 0) { - return XCDR_AUTO(); - } else if (REDAString_iCompare( - value.c_str(), - JSON_SQLITE().enum_value().c_str()) == 0) { - return JSON_SQLITE(); - } else { - throw dds::core::UnsupportedError( - "Unrecognized DB Format value, must be one of " - "{XCDR,XCDR2,XCDR_AUTO,JSON_SQLITE}"); - } - } - - EStorageFormat(const EStorageFormat& other) - : enum_value_(other.enum_value_), - enum_string_(other.enum_string_), - data_rep_id_(other.data_rep_id_){} - - void operator =(const EStorageFormat& other) - { - enum_value_ = other.enum_value_; - enum_string_ = other.enum_string_; - data_rep_id_ = other.data_rep_id_; - } - - bool operator ==(const EStorageFormat& other) const - { - return enum_value_ == other.enum_value_; - } - - bool operator !=(const EStorageFormat& other) const - { - return enum_value_ != other.enum_value_; - } - - uint32_t value() const { return enum_value_; } - - const std::string& enum_value() const { return enum_string_; } - - /** - * This function returns the associated data representation when it applies. - * In the cases it doesn't, it returns the value INVALID_REPRESENTATION - */ - DDS_DataRepresentationId_t data_representation() const - { - return data_rep_id_; - } - -private: - uint32_t enum_value_; - std::string enum_string_; - DDS_DataRepresentationId_t data_rep_id_; - - EStorageFormat( - const uint32_t value, - const std::string& enum_string, - const DDS_DataRepresentationId_t rep_id) : - enum_value_(value), - enum_string_(enum_string), - data_rep_id_(rep_id) {} - -}; - -} } } /* namespace rti::recording::storage */ - -#endif /* HPP_RTI_RECORDING_STORAGE_ESTORAGEFORMAT_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/SelectorState.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/SelectorState.hpp deleted file mode 100644 index 7bee642b4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/SelectorState.hpp +++ /dev/null @@ -1,250 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2018-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_RTI_RECORDING_STORAGE_SAMPLESELECTOR_HPP_ -#define HPP_RTI_RECORDING_STORAGE_SAMPLESELECTOR_HPP_ - -#include "dds/dds.hpp" -#include "rti/core/NativeValueType.hpp" -#include "rti/core/constants.hpp" -#include "rti/apputils/util/Utils.hpp" - -#include "recordingservice/recordingservice_storagereader.h" - -namespace rti { namespace recording { namespace storage { - -class SelectorState; - - -/** - * Adapter class for the native type RTI_RecordingServiceSelectorState. - */ -class SelectorStateAdapter { -public: - typedef RTI_RecordingServiceSelectorState native_type; - - static void initialize(native_type& native_value) - { - RTI_RecordingServiceSelectorState native_state = - RTI_RecordingServiceSelectorState_INITIALIZER; - memcpy(&native_value, &native_state, sizeof(native_state)); - } - - static void finalize(native_type&) - { - } - - static void copy(native_type& destination, const native_type& source) - { - destination.sample_state = source.sample_state; - destination.time_range_start = source.time_range_start; - destination.time_range_end = source.time_range_end; - destination.max_samples = source.max_samples; - destination.instance_history = source.instance_history; - } - - static bool equals(const native_type& first, const native_type& second) - { - if (first.sample_state != second.sample_state) { - return false; - } - if (first.max_samples != second.max_samples) { - return false; - } - if (!DDS_Time_t_equals( - first.time_range_start, - second.time_range_start)) { - return false; - } - if (!DDS_Time_t_equals( - first.time_range_end, - second.time_range_end)) { - return false; - } - return first.instance_history.depth == second.instance_history.depth; - } -}; - -} } - -/* - * Type native_type_traits needs to be defined in the rti::core namespace. - */ -namespace core { - -template <> -struct native_type_traits { - typedef rti::recording::storage::SelectorStateAdapter adapter_type; - typedef RTI_RecordingServiceSelectorState native_type; -}; - -} - -namespace recording { namespace storage { - -/** \ingroup RTI_RecordingServiceStorageModule - * - * @brief This class is used by \replay_product or \converter_product when - * asking the storage plugin for data. It specifies whether the samples should - * be 'not read' samples, that haven't been returned before, or that 'any' - * sample state is needed. It also allows to specify the time range the samples - * returned have to lay within (upper and lower limit). - */ -class SelectorState : public rti::core::NativeValueType { -public: - RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(SelectorState) - - typedef rti::core::NativeValueType Base; - - SelectorState() - { - } - - SelectorState(const RTI_RecordingServiceSelectorState &native) : - Base(native) - { - } - - /** - * @brief Returns the sample state. This is used to represent the state of - * the samples asked for, whether they have been already read or not. - * When this value is set to: - * - Not read: the storage plugin should provide samples that hasn't - * provided before. This implies that the storage plugin has to - * keep track of what samples it has already returned and what - * samples it hasn't. - * - Any: the storage plugin should provide all the samples within - * the specified time range, no matter their read state. This - * implies a stateless read, the storage plugin is not supposed to - * keep track of what samples have been read or not in this case. - * - Read: in the current version, this sample state is not used by - * \replay_product or \converter_product. - */ - inline dds::sub::status::SampleState sample_state() const - { - return dds::sub::status::SampleState(native().sample_state); - } - - /** - * @brief Sets the sample state. - */ - SelectorState& sample_state(const dds::sub::status::SampleState& state) - { - native().sample_state = - static_cast( - state.to_ulong()); - return *this; - } - - /** - * @brief Returns the time that represents the lower limit (inclusive) of - * the time range the retrieved data samples should lay within. When - * retrieving stateful samples (not read), this parameter becomes - * irrelevant as the lower limit should be the time-stamp of the - * latest sample returned. - */ - inline dds::core::Time time_range_start() const - { - return dds::core::Time( - native().time_range_start.sec, - native().time_range_start.nanosec); - } - - /** - * @brief Like the time_range_start() method, but returns the timestamp in - * long long (int-64) format - */ - inline int64_t timestamp_range_start() const - { - return rti::apputils::util::convert_uint64_into_int64( - rti::apputils::util::to_nanosecs(time_range_start())); - } - - /** - * @brief Sets the lower limit of the time range. - */ - SelectorState& time_range_start(const dds::core::Time& time_range_start) - { - native().time_range_start.sec = time_range_start.sec(); - native().time_range_start.nanosec = - (DDS_UnsignedLong) time_range_start.nanosec(); - return *this; - } - - /** - * @brief Returns the time that represents the upper limit (inclusive) of - * the time range the retrieved samples should lay within. This - * parameter is always relevant, as samples should be returned in - * increasing time-stamp order. - */ - inline dds::core::Time time_range_end() const - { - return dds::core::Time( - native().time_range_end.sec, - native().time_range_end.nanosec); - } - - /** - * @brief Like the time_range_end() method, but returns the timestamp in - * long long (int-64) format - */ - inline int64_t timestamp_range_end() const - { - return rti::apputils::util::convert_uint64_into_int64( - rti::apputils::util::to_nanosecs(time_range_end())); - } - - /** - * @brief Sets the upper limit of the time range. - */ - SelectorState& time_range_end(const dds::core::Time& time_range_end) - { - native().time_range_end.sec = time_range_end.sec(); - native().time_range_end.nanosec = - static_cast(time_range_end.nanosec()); - return *this; - } - - /** - * @brief Returns the maximum number of samples to be returned by a single - * read() call, when the value is positive. - * A negative value indicates an unlimited number of samples. - */ - inline int32_t max_samples() const - { - return native().max_samples; - } - - /** - * @brief Sets the maximum number of samples to be returned by a single call - * to read(). - */ - SelectorState& max_samples(const int32_t max_samples) - { - native().max_samples = (int) max_samples; - return *this; - } - - inline int32_t instance_history_depth() const - { - return native().instance_history.depth; - } - - SelectorState& instance_history_depth(const int32_t depth) - { - native().instance_history.depth = (int) depth; - return *this; - } - -}; - - -} } } /* namespace rti::recording::storage */ - -#endif /* HPP_RTI_RECORDING_STORAGE_SAMPLESELECTOR_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDefs.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDefs.hpp deleted file mode 100644 index 0435cb8ec..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDefs.hpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2018-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_RTI_RECORDING_STORAGE_STORAGEDEFS_HPP_ -#define HPP_RTI_RECORDING_STORAGE_STORAGEDEFS_HPP_ - -#include -#include - -#ifndef dds_c_builtin_h -#include "dds_c/dds_c_builtin.h" -#endif - -#include -#include "rti/recording/PropertySet.hpp" - -#include "recordingservice/recordingservice_storagereader.h" -#include "recordingservice/recordingservice_storagewriter.h" - -namespace rti { namespace recording { - -// Writer-related defines - -typedef std::shared_ptr - StorageWriterSharedPtr; -typedef std::shared_ptr - StorageStreamWriterSharedPtr; -typedef std::shared_ptr - StorageParticipantWriterSharedPtr; -typedef std::shared_ptr - StoragePublicationWriterSharedPtr; -typedef std::shared_ptr - StorageSubscriptionWriterSharedPtr; - -// Reader-related defines -typedef std::shared_ptr - StorageReaderSharedPtr; -typedef std::shared_ptr - StorageStreamReaderSharedPtr; -typedef std::shared_ptr - StorageStreamInfoReaderSharedPtr; - -/* - * Helper classes to be used with the pointer definitions above, to create the - * smart pointers and use this class as a deleter (pointing to the () operator) - */ - -class NativeStorageStreamWriterDeleter { -public: - NativeStorageStreamWriterDeleter( - RTI_RecordingServiceStorageWriter *storage_writer_parent) - : storage_writer_parent_(storage_writer_parent) - { - RTI_CHECK_PRECONDITION(storage_writer_parent != NULL); - } - - void operator ()(RTI_RecordingServiceStorageStreamWriter *instance) - { - if (instance != NULL) { - storage_writer_parent_->delete_stream_writer( - storage_writer_parent_, - instance); - } - } - - void operator ()(RTI_RecordingServiceStorageParticipantWriter *instance) - { - // The delete participant writer operation is not required, better be - // safe than sorry - if (instance != NULL - && storage_writer_parent_->delete_participant_writer != NULL) { - storage_writer_parent_->delete_participant_writer( - storage_writer_parent_, - instance); - } - } - - void operator ()(RTI_RecordingServiceStoragePublicationWriter *instance) - { - // The delete publication writer operation is not required, better be - // safe than sorry - if (instance != NULL - && storage_writer_parent_->delete_publication_writer != NULL) { - storage_writer_parent_->delete_publication_writer( - storage_writer_parent_, - instance); - } - } - - void operator ()(RTI_RecordingServiceStorageSubscriptionWriter *instance) - { - // The delete subscription writer operation is not required, better be - // safe than sorry - if (instance != NULL - && storage_writer_parent_->delete_subscription_writer != NULL) { - storage_writer_parent_->delete_subscription_writer( - storage_writer_parent_, - instance); - } - } - -private: - RTI_RecordingServiceStorageWriter *storage_writer_parent_; -}; - -class NativeStorageStreamInfoReaderDeleter { -public: - NativeStorageStreamInfoReaderDeleter( - RTI_RecordingServiceStorageReader *storage_reader_parent) - : storage_reader_parent_(storage_reader_parent) - { - RTI_CHECK_PRECONDITION(storage_reader_parent != NULL); - } - - void operator ()(RTI_RecordingServiceStorageStreamInfoReader *instance) - { - if (instance != NULL) { - storage_reader_parent_->delete_stream_info_reader( - storage_reader_parent_, - instance); - } - } - -private: - RTI_RecordingServiceStorageReader *storage_reader_parent_; -}; - -class NativeStorageStreamReaderDeleter { -public: - NativeStorageStreamReaderDeleter( - RTI_RecordingServiceStorageReader *storage_reader_parent) - : storage_reader_parent_(storage_reader_parent) - { - RTI_CHECK_PRECONDITION(storage_reader_parent != NULL); - } - - void operator ()(RTI_RecordingServiceStorageStreamReader *instance) - { - if (instance != NULL) { - storage_reader_parent_->delete_stream_reader( - storage_reader_parent_, - instance); - } - } - -private: - RTI_RecordingServiceStorageReader *storage_reader_parent_; -}; - -inline bool is_discovery_stream(const std::string& stream_name) -{ - if (stream_name.compare(DDS_PARTICIPANT_TOPIC_NAME) == 0 - || stream_name.compare(DDS_PUBLICATION_TOPIC_NAME) == 0 - || stream_name.compare(DDS_SUBSCRIPTION_TOPIC_NAME) == 0) { - return true; - } - return false; -} - -inline std::string domain_id_property_name() -{ - return RTI_RECORDING_SERVICE_DOMAIN_ID_PROPERTY_NAME; -} - -inline std::string start_timestamp_property_name() -{ - return RTI_RECORDING_SERVICE_START_TIMESTAMP_PROPERTY_NAME; -} - -inline std::string end_timestamp_property_name() -{ - return RTI_RECORDING_SERVICE_END_TIMESTAMP_PROPERTY_NAME; -} - -inline std::string jump_timestamp_property_name() -{ - return RTI_RECORDING_SERVICE_JUMP_TIMESTAMP_PROPERTY_NAME; -} - -inline std::string sample_order_property_name() -{ - return RTI_RECORDING_SERVICE_PLAYBACK_SAMPLE_ORDER_PROPERTY_NAME; -} - -inline std::string reverse_mode_property_name() -{ - return RTI_RECORDING_SERVICE_PLAYBACK_REVERSE_MODE_PROPERTY_NAME; -} - -template -inline T get_from_properties( - const rti::recording::PropertySet& properties, - const std::string& property_name) -{ - rti::recording::PropertySet::const_iterator found = - properties.find(property_name); - if (found == properties.end()) { - throw dds::core::Error( - "!found property with name=" + property_name); - } - T value; - std::stringstream str_stream(found->second); - str_stream >> value; - if (str_stream.fail()) { - throw dds::core::Error( - "!parse value from property with name=" + property_name); - } - return value; -} - -template -inline void add_to_properties( - rti::recording::PropertySet& properties, - const std::string& property_name, - const T value) -{ - rti::recording::PropertySet::const_iterator found = - properties.find(property_name); - if (found != properties.end()) { - return; - } - std::stringstream str_stream; - str_stream << value; - if (str_stream.fail()) { - throw dds::core::Error( - "!add value for property with name=" + property_name); - } - properties[property_name] = str_stream.str(); -} - -namespace detail { - -#define RecorderPrint_exception(...) \ - RTILogMessage_print( \ - RTI_LOG_PRINT_FORMAT_MASK_ALL, \ - RTI_LOG_BIT_EXCEPTION, \ - MODULE_RECORDER, \ - __VA_ARGS__) - -} /* namespace rti::recording::detail */ - - -} } /* namespace rti::recording */ - -#endif /* HPP_RTI_RECORDING_STORAGE_STORAGEDEFS_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDiscoveryStreamWriter.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDiscoveryStreamWriter.hpp deleted file mode 100644 index a0ee0b73b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageDiscoveryStreamWriter.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2018-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_STORAGE_STORAGEDISCOVERYSTREAMWRITER_HPP_ -#define RTI_RECORDING_STORAGE_STORAGEDISCOVERYSTREAMWRITER_HPP_ - -#include - -#include "dds/dds.hpp" - -#include "rti/recording/storage/StorageStreamWriter.hpp" -#include "rti/routing/detail/ForwarderUtils.hpp" - -namespace rti { namespace recording { namespace storage { - -/** \ingroup RTI_RecordingServiceStorageModule - * - * @brief Convenience definition of typed StorageStreamWriter that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - * - */ -typedef TStorageStreamWriter< - dds::topic::ParticipantBuiltinTopicData, - dds::sub::SampleInfo> ParticipantStorageWriter; - -/** \ingroup RTI_RecordingServiceStorageModule - * @brief Convenience definition of typed StorageStreamWriter that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - * - */ -typedef TStorageStreamWriter< - dds::topic::PublicationBuiltinTopicData, - dds::sub::SampleInfo> PublicationStorageWriter; - -/** \ingroup RTI_RecordingServiceStorageModule - * @brief Convenience definition of typed StorageStreamWriter that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - * - */ -typedef TStorageStreamWriter< - dds::topic::SubscriptionBuiltinTopicData, - dds::sub::SampleInfo> SubscriptionStorageWriter; - - -} } } // namespace rti::recording::storage - -#endif /* RTI_RECORDING_STORAGE_STORAGEDISCOVERYSTREAMWRITER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageReader.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageReader.hpp deleted file mode 100644 index 0c2afeecf..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageReader.hpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2018-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef HPP_RECORDER_DB_REPLAYPLUGIN_HPP_ -#define HPP_RECORDER_DB_REPLAYPLUGIN_HPP_ - -#include "dds/dds.hpp" -#include "rti/recording/PropertySet.hpp" -#include "rti/recording/StreamInfo.hpp" - -#include "StorageStreamInfoReader.hpp" -#include "rti/recording/storage/StorageStreamReader.hpp" - -/** @file - * @brief \product Pluggable Storage Reader API - * - * These APIs define a plugin that can be used by \replay_product and - * \converter_product to retrieve data from storage. - */ - -/** - * @brief The RTI namespace. - * - */ -namespace rti { - -/** - * @brief The \product namespace. - * - * The \product namespace includes all public classes of \product - */ -namespace recording { - -/** - * @brief The \product storage namespace. - * - * The \product namespace includes all classes needed to plug in custom storage. - */ -namespace storage { - -/** \ingroup RTI_RecordingServiceStorageModule - * class rti::recording::storage::StorageReader - * @brief Storage reader - * - * This class creates and deletes: - * - StreamInfoReaders, that will be used to query discovery data from - * storage and provide it to \replay_product and \converter_product - * - StreamReaders, that will be used to query user data from storage and - * provide it to \replay_product and \converter_product - */ -class StorageReader { -public: - - typedef void* SampleType; - typedef void* InfoType; - typedef std::vector SampleSeqType; - typedef std::vector InfoSeqType; - - /** - * @memberof rti::recording::storage::StorageReader - * @brief Constructor. - * - * Creates a StorageReader object. - * - * @param properties Routing Service PropertySet. Contains name/value - * pairs that can be passed to the plugin in the XML, using the - * following snippet: - \verbatim - - - - - - example.filename - PluggableStorage.dat - - - - - - - \endverbatim - */ - StorageReader(const rti::recording::PropertySet& properties) - { - RTI_UNUSED_PARAMETER(properties); - } - - /** - * @brief Virtual destructor - */ - virtual ~StorageReader() - { - } - - /** - * @brief \replay_product calls this to create a stream in charge of - * discovering information about the available user-data streams in the - * storage, and read them. - * - * @param properties A collection of name-value properties. They include - * some built-in values, like: - * 1) name='rti.recording_service.start_timestamp' - * value=the initial timestamp of the selected time range (64-bit - * integer in text format) for this stream info reader to query - * data - * 2) name='rti.recording_service.end_timestamp' - * value=the final timestamp of the selected time range (64-bit - * integer in text format) for this stream info reader to query - * data - * 3) name='rti.recording_service.playback_settings.sample_order' - * value=the sample order (enum label in text format) for this - * stream info reader to query data. - * The possible values are: RECEPTION_TIMESTAMP, SOURCE_TIMESTAMP. - * 4) name='rti.recording_service.playback_settings.reverse_mode' - * value= the status of the reverse mode (ENABLED or DISABLED) - * for this stream info reader to query data. - * The possible values are: true, false. - */ - virtual StorageStreamInfoReader * create_stream_info_reader( - const rti::recording::PropertySet& properties) = 0; - - /** - * @brief \replay_product calls this to delete a stream information reader - * - * @param stream_info_reader Stream information reader to be deleted. - */ - virtual void delete_stream_info_reader( - StorageStreamInfoReader *stream_info_reader) = 0; - - /** - * @brief \replay_product calls this to create a user-data stream reader. - * - * @param stream_info Information about the stream (DDS topic) this stream - * reader will query from the database. - * @param properties A collection of name-value properties. They include - * some built-in values, like: - * 1) name='rti.recording_service.domain_id' - * value=the DDS domain ID the stream was found in (32-bit integer - * as text) - * 2) name='rti.recording_service.start_timestamp' - * value=the initial timestamp of the selected time range (64-bit - * integer in text format) for this stream info reader to query - * data - * 3) name='rti.recording_service.end_timestamp' - * value=the final timestamp of the selected time range (64-bit - * integer in text format) for this stream info reader to query - * data - * 4) name='rti.recording_service.playback_settings.sample_order' - * value=the sample order (enum label in text format) for this - * stream info reader to query data. - * The possible values are: RECEPTION_TIMESTAMP, SOURCE_TIMESTAMP. - * 5) name='rti.recording_service.playback_settings.reverse_mode' - * value= the status of the reverse mode (ENABLED or DISABLED) - * for this stream info reader to query data. - * The possible values are: true, false. - */ - virtual StorageStreamReader * create_stream_reader( - const rti::recording::StreamInfo& stream_info, - const rti::recording::PropertySet& properties) = 0; - - /** - * @brief \replay_product calls this to delete a stream reader. - * - * @param stream_reader Stream reader to be deleted. - */ - virtual void delete_stream_reader(StorageStreamReader *stream_reader) = 0; - -private: - - StorageReader() {} - -}; - -} } } /* namespace rti::recording::storage */ - -#include "rti/recording/storage/detail/StorageReaderForwarder.hpp" -#include "rti/routing/ServiceProperty.hpp" -#include "rti/routing/detail/ForwarderUtils.hpp" - -/** \ingroup RTI_RecordingServiceStorageModule - * @def RTI_RECORDING_STORAGE_READER_CREATE_DECL - * @brief Convenience macro to declare the C-style function that will be called - * by \replay_product and \converter_product to create your class - * - * This macro automatically declares a C wrapper function for your class - * creation. \replay_product and \converter_product must be initialized - * with the name of this function. For example if your StorageReader class is - * 'FileStorageReader' this creates wrapper function called - * 'FileStorageReader_get_storage_reader' that you must specify in your XML - * file, such as: - * - * \verbatim - - - FileStorageReader - FileStorageReader_get_storage_reader - - - \endverbatim - */ -#define RTI_RECORDING_STORAGE_READER_CREATE_DECL(STORAGE_READER_CLASS) \ -extern "C" RTI_USER_DLL_EXPORT \ -struct RTI_RecordingServiceStorageReader * \ -STORAGE_READER_CLASS ## _get_storage_reader( \ - const struct RTI_RoutingServiceProperties *); - -/** \ingroup RTI_RecordingServiceStorageModule - * @brief Convenience macro to implement the C-style function that will be - * called by \replay_product and \converter_product to create your class - * - * This macro automatically defines a C wrapper function for your class - * creation. \replay_product and \converter_product must be initialized - * with the name of this function. - */ -#define RTI_RECORDING_STORAGE_READER_CREATE_DEF(STORAGE_READER_CLASS) \ -struct RTI_RecordingServiceStorageReader * \ -STORAGE_READER_CLASS ## _get_storage_reader( \ - const struct RTI_RoutingServiceProperties *native_properties) \ -{ \ - rti::recording::PropertySet properties; \ - rti::routing::PropertyAdapter::add_properties_from_native( \ - properties, \ - native_properties); \ - return new rti::recording::storage::detail::StorageReaderForwarder( \ - new STORAGE_READER_CLASS(properties)); \ -} - -#endif /* HPP_RECORDER_DB_REPLAYPLUGIN_HPP_ */ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamInfoReader.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamInfoReader.hpp deleted file mode 100644 index 6ab7e5c69..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamInfoReader.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/****************************************************************************** - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - *****************************************************************************/ - -#ifndef HPP_RTI_RECORDING_STORAGE_DISCOVERYSTREAMREADER_HPP_ -#define HPP_RTI_RECORDING_STORAGE_DISCOVERYSTREAMREADER_HPP_ - -#include "dds/dds.hpp" -#include "rti/recording/StreamInfo.hpp" - -#include "SelectorState.hpp" - -namespace rti { namespace recording { namespace storage { - -/** \ingroup RTI_RecordingServiceStorageModule - * class rti::recording::storage::StorageStreamInfoReader - * @brief Storage discovery stream reader - * - * This class is used by the \replay_product and \converter_product to query - * the contents of storage to be replayed or converted, including: - * - The names of streams that are stored, and their associated type - * representations, when recorded. - * - The domain IDs associated with those streams. - * - The first and last timestamps in the stored data. - */ -class StorageStreamInfoReader { -public: - - /** - * @brief Virtual destructor - * - */ - virtual ~StorageStreamInfoReader() {} - - /** - * @brief Retrieve stream information data from storage. This operation - * should behave differently depending on the product's needs, stated in the - * SelectorState object passed as a parameter. The stream info samples have - * to be provided in increasing time-stamp order (reception time-stamp). - * - * \replay_product and \converter_product will call this method to - * retrieve discovery data from the plugins. Discovery data describes which - * streams are available from storage. - * - * @param sample_seq Vector of SampleType data. A SampleType is - * an rti::recording::StreamInfo. - * @param selector Provides the statefulness and constraints of the data - * queried by \replay_product or \converter_product. When the - * selector's sample state is set to 'any', it means its asking for - * stateless information (it doesn't care whether the data has been - * read before or not). When the selector's sample state is set to - * 'not read' then it's a stateful read, and only samples that - * weren't given to the application before have to be provided. - * Note: for the moment, \replay_product or - * \converter_product won't ask for data with sample state equal to - * 'read', so this state can be ignored. - * - * When Replay Service is on reverse mode, it will set the selector's - * start timestamp to 0. In this mode, Replay Service will burst all - * the discovery information at the beginning of the replay. - * After this burst of samples, the discovery stream reader will wait - * until the end of the replay. - */ - virtual void read( - std::vector& sample_seq, - const SelectorState& selector) = 0; - - /** - * @brief Notifies plugin it can release the read stream information objects - * - * @param sample_seq A vector of stream info objects that the plugin can - * now release resources for. - */ - virtual void return_loan( - std::vector& sample_seq) = 0; - - /** - * @brief The time within the recorded time range that can be considered - * time zero of the recording - */ - virtual int64_t service_start_time() = 0; - - /** - * @brief The time relative to the recorded time range that can be - * considered the final recording time of the recording - */ - virtual int64_t service_stop_time() = 0; - - /** - * @brief Whether this discovery stream has finished with all discovery data - * or not. - */ - virtual bool finished() = 0; - - /** - * @brief Method used by \replay_product when looping, to start over. After - * this method is called, the stream reader should be ready to start reading - * data from the beginning of the stream, again. - */ - virtual void reset() = 0; -}; - -} } } /* namespace rti::recording::storage */ - -#endif /* HPP_RTI_RECORDING_STORAGE_DISCOVERYSTREAMREADER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamReader.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamReader.hpp deleted file mode 100644 index 00a3b6b49..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamReader.hpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - * - */ - -#ifndef HPP_RTI_RECORDING_STORAGE_STREAMREADER_HPP_ -#define HPP_RTI_RECORDING_STORAGE_STREAMREADER_HPP_ - -#include - -#include "dds/dds.hpp" - -#include "rti/routing/detail/ForwarderUtils.hpp" - -#include "rti/recording/storage/SelectorState.hpp" - - -namespace rti { namespace recording { namespace storage { - -/** \ingroup RTI_RecordingServiceStorageModule - * class rti::recording::storage::StorageStreamReader - * @brief Storage stream reader - * - * This class retrieves user data from storage. - */ -class StorageStreamReader { -public: - - typedef void* SamplePtr; - typedef void* InfoPtr; - - /** - * @brief Virtual destructor - */ - virtual ~StorageStreamReader() - { - } - - /** - * @brief Method called by \replay_product and \converter_product - * to retrieve samples from storage for a particular stream - * (DDS topic). The data samples retrieved have to be provided in - * increasing time-stamp order (reception time-stamp). - * - * @param sample_seq A vector of data samples that \replay_product or - * \converter_product will replay or convert to a new format. - * A SampleType is a DDS_DynamicData * cast as a void * - * @param info_seq A vector of sample information about the samples, - * such as recorded timestamps of the sample data. An InfoType is - * a DDS_SampleInfo * cast as a void *. - * @param selector Provides the statefulness and constraints of the data - * queried by \replay_product or \converter_product. When the - * selector's sample state is set to 'any', it means its asking for - * stateless information (it doesn't care whether the data has been - * read before or not). When the selector's sample state is set to - * 'not read' then it's a stateful read, and only samples that - * weren't given to the application before have to be provided. - * Note: for the moment, \replay_product or - * \converter_product won't ask for data with sample state equal to - * 'read', so this state can be ignored. - * - * When the selector's start timestamp is set to a value different - * than 0, it means that Replay Service is on a jumping process. - * The StreamReader should then prepare its statement with this - * new start timestamp. Also, if the selector's maximum samples is - * set to 0, it means that Replay Service is on a jumping breakpoint process - * instead of a standard jumping process. In this case, the StreamReader - * should also prepare the statement but it should not read any sample. - */ - virtual void read( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector) = 0; - /** - * @brief Method for releasing resources related to the queried data - * samples. - * - * This is called back when the \replay_product or \converter_product has - * finished with the data samples queried in the take() function, and - * wants to notify the plugin that it can free any related resources. - * - * @param sample_seq A vector of sample objects that the plugin can - * now free. - * @param info_seq A vector of sample_info objects that the plugin can - * now free. - * - */ - virtual void return_loan( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /** - * @brief Method for querying whether there are no more samples for this - * stream. - * - * @return true if there is no more data available for this stream, - * false otherwise. - * - */ - virtual bool finished() = 0; - - /** - * @brief Method used by \replay_product when looping, to start over. After - * this method is called, the stream reader should be ready to start reading - * data from the beginning of the stream, again. - */ - virtual void reset() = 0; -}; - -/** \ingroup RTI_RecordingServiceStorageModule - * class rti::recording::storage::TStorageStreamReader - * @brief A templatized wrapping implementation of StorageStreamReader, - * providing a strongly-typed interface regarding data and info representations. - * - * You can implement this interface as a convenience to manipulate the data - * and info representation without dealing with opaque pointers. - */ -template -class TStorageStreamReader : public StorageStreamReader { -public: - - /** - * @brief The data type - */ - typedef Data DataRep; - /** - * @brief The info type - */ - typedef Info InfoRep; - - using StorageStreamReader::read; - using StorageStreamReader::return_loan; - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-typed pointers. - */ - void read( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector) RTI_FINAL - { - read(sample_seq_, info_seq_, selector); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq, sample_seq_); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(info_seq, info_seq_); - } - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-typed pointers. - */ - void return_loan( - std::vector& sample_seq, - std::vector& info_seq) RTI_FINAL - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq_, sample_seq); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(info_seq_, info_seq); - return_loan(sample_seq_, info_seq_); - sample_seq_.clear(); - info_seq_.clear(); - } - - virtual void read( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector) = 0; - - virtual void return_loan( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /* - * @brief Virtual destructor - */ - virtual ~TStorageStreamReader() {} - -private: - - std::vector sample_seq_; - std::vector info_seq_; -}; - -/** \ingroup RTI_RecordingServiceStorageModule - * @brief Convenience definition of typed StorageStreamReader that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - */ -typedef TStorageStreamReader< - dds::core::xtypes::DynamicData, - dds::sub::SampleInfo> DynamicDataStorageStreamReader; - -} } } // namespace rti::recording::storage - -#endif /* HPP_RTI_RECORDING_STORAGE_STREAMREADER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamWriter.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamWriter.hpp deleted file mode 100644 index 877d6b91e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageStreamWriter.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_STORAGE_STORAGESTREAMWRITER_HPP_ -#define RTI_RECORDING_STORAGE_STORAGESTREAMWRITER_HPP_ - -#include - -#include "dds/dds.hpp" - -#include "rti/routing/detail/ForwarderUtils.hpp" - -namespace rti { namespace recording { namespace storage { - -/** \ingroup RTI_RecordingServiceStorageModule - * class rti::recording::storage::StorageStreamWriter - * @brief Storage stream writer - * - * Inherit from this class and implement the store method to store data to - * the storage of your choice. - */ -class StorageStreamWriter { -public: - - typedef void* SamplePtr; - typedef void* InfoPtr; - - /** - * @brief Virtual destructor - */ - virtual ~StorageStreamWriter() {} - - /** - * @brief Implement this method to store data in the storage of your choice. - * - * @param sample_seq Vector of SamplePtr objects containing the data to - * store. A SamplePtr is generally a DDS_DynamicData *, unless - * this is a discovery stream, in which case this is the builtin - * discovery type. Check the stream name to determine if this is a - * discovery stream. - * @param info_seq Vector of InfoType objects. An InfoType is a - * DDS_SampleInfo * cast to a void *. - */ - virtual void store( - const std::vector& sample_seq, - const std::vector& info_seq) = 0; -}; - - -/** \ingroup RTI_RecordingServiceStorageModule - * class rti::recording::storage::TStorageStreamWriter - * @brief A templatized wrapping implementation of StorageStreamWriter, - * providing a strongly-typed interface regarding data and info representations. - * - * You can implement this interface as a convenience to manipulate the data - * and info representation without dealing with opaque pointers. - */ -template -class TStorageStreamWriter : public StorageStreamWriter { -public: - - /** - * @brief The data type - */ - typedef Data DataRep; - /** - * @brief The info type - */ - typedef Info InfoRep; - - using StorageStreamWriter::store; - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-typed pointers. - */ - void store( - const std::vector& sample_seq, - const std::vector& info_seq) - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq_, sample_seq); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(info_seq_, info_seq); - - store(sample_seq_, info_seq_); - } - - /** - * @brief Interface redefinition - * - * @see StorageStreamWriter::store - */ - virtual void store( - const std::vector& sample_seq, - const std::vector& info_seq) = 0; - - /** - * @brief Virtual destructor - */ - virtual ~TStorageStreamWriter() - { - } - -private: - std::vector sample_seq_; - std::vector info_seq_; - -}; - -/** \ingroup RTI_RecordingServiceStorageModule - * @brief Convenience definition of typed StorageStreamWriter that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - * - */ -typedef TStorageStreamWriter< - dds::core::xtypes::DynamicData, - dds::sub::SampleInfo> DynamicDataStorageStreamWriter; - - -} } } // namespace rti::recording::storage - -#endif /* HPP_RTI_RECORDING_STORAGE_STORAGESTREAMWRITER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageWriter.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageWriter.hpp deleted file mode 100644 index 65d9f0a2a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/StorageWriter.hpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2016-. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#include "rti/recording/PropertySet.hpp" -#include "rti/recording/StreamInfo.hpp" -#include "rti/recording/storage/StorageStreamWriter.hpp" -#include "rti/recording/storage/StorageDiscoveryStreamWriter.hpp" -#include "dds/dds.hpp" - -#ifndef HPP_RTI_RECORDING_STORAGE_STORAGEWRITER_HPP_ -#define HPP_RTI_RECORDING_STORAGE_STORAGEWRITER_HPP_ - -/** @file - * @brief \product Pluggable Storage Writer API - * - * These APIs define a plugin that can be used by \product - * to store data. - */ - -namespace rti { namespace recording { namespace storage { - -/** \ingroup RTI_RecordingServiceStorageModule - * class rti::recording::storage::StorageWriter - * @brief Storage writer - * - * This class is responsible for creating StorageStreamWriters when notified - * that a new stream has been discovered. A stream is defined by a Topic/type - * combination - */ -class StorageWriter { -public: - - /** - * @brief Constructor. - * - * Creates a StorageWriter object. - * - * @param properties Routing Service PropertySet. Contains name/value - * pairs that can be passed to the plugin in the XML, using the - * following snippet: - \verbatim - - - - - - - - example.filename - PluggableStorage.dat - - - - - - - \endverbatim - */ - StorageWriter(const rti::recording::PropertySet& properties) - { - RTI_UNUSED_PARAMETER(properties); - } - - /** - * @brief Virtual destructor - */ - virtual ~StorageWriter() {} - - /** - * @brief \product calls this to create a user-data stream writer. - * The built-in DDS discovery topics can be recorded, however, - * \product will use the create_discovery_stream_writer() call to - * obtain a stream writer for those types. - * @param stream_info Information about the stream to be created, such as - * stream name (DDS topic name). - * @param properties A collection of value-pair properties. They include - * some built-in values, like: - * 1) name='rti.recording_service.domain_id' - * value=the DDS domain ID the stream was found in (32-bit integer - * as text) - * - * @see create_discovery_stream_writer - */ - virtual StorageStreamWriter * create_stream_writer( - const rti::recording::StreamInfo& stream_info, - const rti::recording::PropertySet& properties) = 0; - - /** - * @brief \product calls this to create a stream writer for the DDS built-in - * topic DCPSParticipant. - * In order for the stream writer to be created, this function has to - * be implemented. Otherwise, no DCPSParticipant data will be - * recorded. - * @see ParticipantStorageWriter - */ - virtual ParticipantStorageWriter * create_participant_writer() - { - return NULL; - } - - /** - * @brief \product calls this to create a stream writer for the DDS built-in - * topic DCPSPublication. - * In order for the stream writer to be created, this function has to - * be implemented. Otherwise, no DCPSPublication data will be - * recorded. - * @see PublicationStorageWriter - */ - virtual PublicationStorageWriter * create_publication_writer() - { - return NULL; - } - - /** - * @brief \product calls this to create a stream writer for the DDS built-in - * topic DCPSSubscription. - * In order for the stream writer to be created, this function has to - * be implemented. Otherwise, no DCPSSubscription data will be - * recorded. - * @see SubscriptionStorageWriter - */ - virtual SubscriptionStorageWriter * create_subscription_writer() - { - return NULL; - } - - /** - * @brief \product calls this to delete a stream writer. This method should - * be able to work with any stream, user-data or discovery. - * - * @param writer Stream Writer to be deleted. - */ - virtual void delete_stream_writer(StorageStreamWriter *writer) = 0; - -private: - - StorageWriter() {} -}; - -} } } /* namespace rti::recording::storage */ - -#include "rti/recording/storage/detail/StorageWriterForwarder.hpp" -#include "rti/routing/ServiceProperty.hpp" -#include "rti/routing/detail/ForwarderUtils.hpp" - -/** \ingroup RTI_RecordingServiceStorageModule - * @def RTI_RECORDING_STORAGE_WRITER_CREATE_DECL - * @brief Convenience macro to declare the C-style function that will be called - * by \product to create your class - * - * This macro automatically declares a C wrapper function for your class - * creation. \product must be initialized - * with the name of this function. For example if your StorageWriter class is - * 'FileStorageWriter' this creates wrapper function called - * 'FileStorageWriter_get_storage_writer' that you must specify in your XML - * file, such as: - * - * \verbatim - - - FileStorageWriter - FileStorageWriter_get_storage_writer - - - \endverbatim - */ -#define RTI_RECORDING_STORAGE_WRITER_CREATE_DECL(STORAGE_WRITER_CLASS) \ -extern "C" RTI_USER_DLL_EXPORT \ -struct RTI_RecordingServiceStorageWriter * \ -STORAGE_WRITER_CLASS ## _get_storage_writer( \ - const struct RTI_RoutingServiceProperties *); - -/** \ingroup RTI_RecordingServiceStorageModule - * @brief Convenience macro to implement the C-style function that will be - * called by \product to create your class - * - * This macro automatically defines a C wrapper function for your class - * creation. \product must be initialized - * with the name of this function. - */ -#define RTI_RECORDING_STORAGE_WRITER_CREATE_DEF(STORAGE_WRITER_CLASS) \ -struct RTI_RecordingServiceStorageWriter * \ -STORAGE_WRITER_CLASS ## _get_storage_writer( \ - const struct RTI_RoutingServiceProperties *native_properties) \ -{ \ - rti::recording::PropertySet properties; \ - rti::routing::PropertyAdapter::add_properties_from_native( \ - properties, \ - native_properties); \ - return new rti::recording::storage::detail::StorageWriterForwarder( \ - new STORAGE_WRITER_CLASS(properties)); \ -} - -#endif /* HPP_RTI_RECORDING_STORAGE_STORAGEWRITER_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageReaderForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageReaderForwarder.hpp deleted file mode 100644 index 6a385ea96..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageReaderForwarder.hpp +++ /dev/null @@ -1,177 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_STORAGE_DETAIL_STORAGE_READER_FORWARDER_HPP_ -#define RTI_RECORDING_STORAGE_DETAIL_STORAGE_READER_FORWARDER_HPP_ - - -#include "log/log_common.h" - -#include "rti/routing/detail/ForwarderUtils.hpp" -#include "rti/routing/ServiceProperty.hpp" - -#include "recordingservice/recordingservice_storagereader.h" -#include "rti/recording/storage/detail/StorageStreamReaderForwarder.hpp" -#include "StorageStreamInfoReaderForwarder.hpp" - -namespace rti { namespace recording { namespace storage { namespace detail { - -class StorageReaderForwarder : public RTI_RecordingServiceStorageReader { -public: - - StorageReaderForwarder(StorageReader *storage_reader) - : storage_reader_(storage_reader) - { - create_stream_reader = StorageReaderForwarder::create_stream_reader_fwd; - delete_stream_reader = StorageReaderForwarder::delete_stream_reader_fwd; - create_stream_info_reader = - StorageReaderForwarder::create_stream_info_reader_fwd; - delete_stream_info_reader = - StorageReaderForwarder::delete_stream_info_reader_fwd; - delete_instance = StorageReaderForwarder::delete_instance_fwd; - - storage_reader_data = this; - } - - ~StorageReaderForwarder() - { - } - - static void delete_instance_fwd( - struct RTI_RecordingServiceStorageReader *storage_reader) - { - try { - StorageReaderForwarder *forwarder = - static_cast(storage_reader); - delete forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static RTI_RecordingServiceStorageStreamReader * create_stream_reader_fwd( - void *storage_reader, - const struct RTI_RoutingServiceStreamInfo *native_stream_info, - const struct RTI_RoutingServiceProperties *native_properties) - { - try { - StorageReaderForwarder *forwarder = - static_cast(storage_reader); - rti::routing::StreamInfo stream_info(*native_stream_info); - rti::routing::PropertySet properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - StorageStreamReaderForwarder *stream_reader_forwarder = - new StorageStreamReaderForwarder( - forwarder->storage_reader_->create_stream_reader( - stream_info, - properties), - forwarder->storage_reader_.get()); - return stream_reader_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - return NULL; - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return NULL; - } - - static void delete_stream_reader_fwd( - void *, - RTI_RecordingServiceStorageStreamReader *storage_stream_reader) - { - try { - StorageStreamReaderForwarder *stream_reader_forwarder = - static_cast( - storage_stream_reader); - delete stream_reader_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static RTI_RecordingServiceStorageStreamInfoReader * - create_stream_info_reader_fwd( - void *storage_reader_data, - const struct RTI_RoutingServiceProperties *native_properties) - { - try { - StorageReaderForwarder *forwarder = - static_cast(storage_reader_data); - rti::routing::PropertySet properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - StorageStreamInfoReaderForwarder *disc_reader_forwarder = - new StorageStreamInfoReaderForwarder( - forwarder->storage_reader_->create_stream_info_reader( - properties), - forwarder->storage_reader_.get()); - return disc_reader_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - return NULL; - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return NULL; - } - - static void delete_stream_info_reader_fwd( - void *, - RTI_RecordingServiceStorageStreamInfoReader *stream_info_reader) - { - try { - StorageStreamInfoReaderForwarder *disc_reader_forwarder = - static_cast( - stream_info_reader); - delete disc_reader_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - -private: - - std::shared_ptr storage_reader_; - -}; - -} } } } - -#endif // RTI_RECORDING_STORAGE_DETAIL_STORAGE_WRITER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamInfoReaderForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamInfoReaderForwarder.hpp deleted file mode 100644 index d5de849e6..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamInfoReaderForwarder.hpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_STORAGE_DETAIL_STORAGE_DISC_STREAM_READER_FORWARDER_HPP_ -#define RTI_RECORDING_STORAGE_DETAIL_STORAGE_DISC_STREAM_READER_FORWARDER_HPP_ - -#include -#include - -#include "rti/recording/storage/StorageStreamInfoReader.hpp" -#include "log/log_common.h" -#include "recordingservice/recordingservice_storagereader.h" - -#include -#include "rti/routing/detail/ForwarderUtils.hpp" - -namespace rti { namespace recording { namespace storage { namespace detail { - -/** - * The following class is a helper to be able to fully associate the life - * of the StorageStreamInfoReader object to a shared pointer, which will provide - * us with RAII capabilities. - */ -class StorageStreamInfoReaderDeleter { -public: - StorageStreamInfoReaderDeleter(StorageReader *storage_reader_parent) - : storage_reader_parent_(storage_reader_parent) - { - RTI_CHECK_PRECONDITION(storage_reader_parent != NULL); - } - - void operator ()(StorageStreamInfoReader *stream_reader_instance) - { - RTI_CHECK_PRECONDITION(stream_reader_instance != NULL); - - storage_reader_parent_->delete_stream_info_reader( - stream_reader_instance); - } - -private: - StorageReader *storage_reader_parent_; -}; - -class StorageStreamInfoReaderForwarder : - public RTI_RecordingServiceStorageStreamInfoReader { -public: - - StorageStreamInfoReaderForwarder( - StorageStreamInfoReader *stream_reader, - StorageReader *storage_reader_parent) - : storage_stream_reader_( - stream_reader, - StorageStreamInfoReaderDeleter(storage_reader_parent)) - { - read = StorageStreamInfoReaderForwarder::read_fwd; - return_loan = StorageStreamInfoReaderForwarder::return_loan_fwd; - get_service_start_time = - StorageStreamInfoReaderForwarder::get_service_start_time_fwd; - get_service_stop_time = - StorageStreamInfoReaderForwarder::get_service_stop_time_fwd; - finished = StorageStreamInfoReaderForwarder::finished_fwd; - reset = StorageStreamInfoReaderForwarder::reset_fwd; - stream_reader_data = this; - } - - ~StorageStreamInfoReaderForwarder() - { - } - - - static void read_fwd( - void *stream_reader_data, - RTI_RoutingServiceStreamInfo ***stream_info_array, - int *array_length, - const struct RTI_RecordingServiceSelectorState *native_selector) - { - try { - StorageStreamInfoReaderForwarder *forwarder = - static_cast( - stream_reader_data); - forwarder->storage_stream_reader_->read( - forwarder->sample_seq_, - SelectorState(*native_selector)); - - *array_length = static_cast(forwarder->sample_seq_.size()); - if (*array_length > 0) { - forwarder->native_sample_seq_.resize(*array_length); - for (size_t i = 0; i < forwarder->sample_seq_.size(); i++) { - forwarder->native_sample_seq_[i] = - &(forwarder->sample_seq_[i]->native()); - } - *stream_info_array = - reinterpret_cast( - forwarder->native_sample_seq_.data()); - } - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static void return_loan_fwd( - void *stream_reader_data, - struct RTI_RoutingServiceStreamInfo **stream_info_array, - int array_length) - { - RTIOsapiUtility_unusedParameter(stream_info_array); - RTIOsapiUtility_unusedParameter(array_length); - - try { - StorageStreamInfoReaderForwarder *forwarder = - static_cast( - stream_reader_data); - // Deleting what's inside the vectors (dynamic data objects) and any - // related objects is responsability of the implementation - forwarder->storage_stream_reader_->return_loan( - forwarder->sample_seq_); - // Clear our internal containers - forwarder->sample_seq_.clear(); - forwarder->native_sample_seq_.clear(); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static long long get_service_start_time_fwd(void *stream_reader_data) - { - try { - StorageStreamInfoReaderForwarder *forwarder = - static_cast( - stream_reader_data); - return (long long) - forwarder->storage_stream_reader_->service_start_time(); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return 0; - } - - static long long get_service_stop_time_fwd(void *stream_reader_data) - { - try { - StorageStreamInfoReaderForwarder *forwarder = - static_cast( - stream_reader_data); - return (long long) - forwarder->storage_stream_reader_->service_stop_time(); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return 0; - } - - static int finished_fwd(void *stream_reader_data) - { - try { - StorageStreamInfoReaderForwarder *forwarder = - static_cast( - stream_reader_data); - return (forwarder->storage_stream_reader_->finished() ? - RTI_TRUE : - RTI_FALSE); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return RTI_FALSE; - } - - static void reset_fwd(void *stream_reader_data) - { - try { - StorageStreamInfoReaderForwarder *forwarder = - static_cast( - stream_reader_data); - forwarder->storage_stream_reader_->reset(); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - StorageStreamInfoReader * stream_reader() - { - return storage_stream_reader_.get(); - } - -private: - std::shared_ptr storage_stream_reader_; - - std::vector sample_seq_; - std::vector native_sample_seq_; - std::vector domain_id_seq_; - -}; - -} } } } // rti::recording::storage::detail - -#endif // RTI_RECORDING_STORAGE_DETAIL_STORAGE_DISC_STREAM_READER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamReaderForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamReaderForwarder.hpp deleted file mode 100644 index a0bc4d7e2..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamReaderForwarder.hpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_STORAGE_DETAIL_STORAGE_STREAM_READER_FORWARDER_HPP_ -#define RTI_RECORDING_STORAGE_DETAIL_STORAGE_STREAM_READER_FORWARDER_HPP_ - -#include -#include - -#include "log/log_common.h" -#include "recordingservice/recordingservice_storagereader.h" - -#include -#include "rti/routing/detail/ForwarderUtils.hpp" - -#include "rti/recording/storage/StorageDefs.hpp" -#include "rti/recording/storage/StorageStreamReader.hpp" -#include "rti/recording/storage/SelectorState.hpp" - -namespace rti { namespace recording { namespace storage { namespace detail { - -/** - * The following class is a helper to be able to fully associate the life - * of the StorageStreamReader object to a shared pointer, which will provide - * us with RAII capabilities. - */ -class StorageStreamReaderDeleter { -public: - StorageStreamReaderDeleter(StorageReader *storage_reader_parent) - : storage_reader_parent_(storage_reader_parent) - { - RTI_CHECK_PRECONDITION(storage_reader_parent != NULL); - } - - void operator ()(StorageStreamReader *stream_reader_instance) - { - RTI_CHECK_PRECONDITION(stream_reader_instance != NULL); - - storage_reader_parent_->delete_stream_reader( - stream_reader_instance); - } - -private: - StorageReader *storage_reader_parent_; -}; - -class StorageStreamReaderForwarder : - public RTI_RecordingServiceStorageStreamReader { -public: - - StorageStreamReaderForwarder( - StorageStreamReader *stream_reader, - StorageReader *storage_reader_parent) - : storage_stream_reader_( - stream_reader, - StorageStreamReaderDeleter(storage_reader_parent)) - { - read = StorageStreamReaderForwarder::read_fwd; - return_loan = StorageStreamReaderForwarder::return_loan_fwd; - finished = StorageStreamReaderForwarder::finished_fwd; - reset = StorageStreamReaderForwarder::reset_fwd; - stream_reader_data = this; - } - - ~StorageStreamReaderForwarder() - { - } - - static void read_fwd( - void *stream_reader_data, - RTI_RoutingServiceSample **sample_array, - RTI_RoutingServiceSampleInfo **sample_info_array, - int *array_length, - const struct RTI_RecordingServiceSelectorState *native_selector) - { - try { - StorageStreamReaderForwarder *forwarder = - static_cast( - stream_reader_data); - forwarder->storage_stream_reader_->read( - forwarder->sample_seq_, - forwarder->info_seq_, - SelectorState(*native_selector)); - *array_length = static_cast(forwarder->sample_seq_.size()); - if (*array_length > 0) { - *sample_array = forwarder->sample_seq_.data(); - *sample_info_array = forwarder->info_seq_.data(); - } - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static void return_loan_fwd( - void *stream_reader_data, - RTI_RoutingServiceSample *sample_array, - RTI_RoutingServiceSampleInfo *sample_info_array, - int array_length) - { - RTIOsapiUtility_unusedParameter(sample_array); - RTIOsapiUtility_unusedParameter(sample_info_array); - RTIOsapiUtility_unusedParameter(array_length); - - try { - StorageStreamReaderForwarder *forwarder = - static_cast( - stream_reader_data); - // Deleting what's inside the vectors (dynamic data objects) and any - // related objects is responsability of the implementation - forwarder->storage_stream_reader_->return_loan( - forwarder->sample_seq_, - forwarder->info_seq_); - // Clear our internal containers - forwarder->sample_seq_.clear(); - forwarder->info_seq_.clear(); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static int finished_fwd(void *stream_reader_data) - { - try { - StorageStreamReaderForwarder *forwarder = - static_cast( - stream_reader_data); - return (forwarder->storage_stream_reader_->finished() ? - RTI_TRUE : - RTI_FALSE); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return RTI_FALSE; - } - - static void reset_fwd(void *stream_reader_data) - { - try { - StorageStreamReaderForwarder *forwarder = - static_cast( - stream_reader_data); - forwarder->storage_stream_reader_->reset(); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - StorageStreamReader * stream_reader() - { - return storage_stream_reader_.get(); - } - -private: - std::shared_ptr storage_stream_reader_; - - std::vector sample_seq_; - std::vector info_seq_; - -}; - -} } } } // rti::recording::storage::detail - -#endif // RTI_RECORDING_STORAGE_DETAIL_STORAGE_STREAM_READER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamWriterForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamWriterForwarder.hpp deleted file mode 100644 index 032ce1cc4..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageStreamWriterForwarder.hpp +++ /dev/null @@ -1,268 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_STORAGE_DETAIL_STORAGE_STREAM_WRITER_FORWARDER_HPP_ -#define RTI_RECORDING_STORAGE_DETAIL_STORAGE_STREAM_WRITER_FORWARDER_HPP_ - -#include -#include - -#include "log/log_common.h" -#include "recordingservice/recordingservice_storagewriter.h" - -#include -#include "rti/routing/detail/ForwarderUtils.hpp" - -#include "rti/recording/storage/StorageStreamWriter.hpp" - -namespace rti { namespace recording { namespace storage { namespace detail { - -/** - * The following class is a helper to be able to fully associate the life - * of the StorageStreamWriter object to a shared pointer, which will provide - * us with RAII capabilities. - */ -class StorageStreamWriterDeleter { -public: - StorageStreamWriterDeleter(StorageWriter *storage_writer_parent) - : storage_writer_parent_(storage_writer_parent) - { - RTI_CHECK_PRECONDITION(storage_writer_parent != NULL); - } - - void operator ()(StorageStreamWriter *stream_writer_instance) - { - if (stream_writer_instance != NULL) { - storage_writer_parent_->delete_stream_writer( - stream_writer_instance); - } - } - -private: - StorageWriter *storage_writer_parent_; -}; - -class StorageStreamWriterForwarder : - public RTI_RecordingServiceStorageStreamWriter { -public: - - StorageStreamWriterForwarder( - StorageStreamWriter *stream_writer, - StorageWriter *storage_writer_parent) - : storage_stream_writer_( - stream_writer, - StorageStreamWriterDeleter(storage_writer_parent)) - { - store = StorageStreamWriterForwarder::store_fwd; - stream_writer_data = this; - } - - ~StorageStreamWriterForwarder() - { - } - - static void store_fwd( - void *stream_writer_data, - const RTI_RoutingServiceSample *samples, - const RTI_RoutingServiceSampleInfo *sample_infos, - const int count) - { - try { - StorageStreamWriterForwarder *forwarder = - static_cast( - stream_writer_data); - // Fill in internal vector with incoming samples - forwarder->sample_seq_.assign(samples, samples + count); - // Fill in internal vector with incoming sample infos, the sample - // info array is optional so check for validity before doing - // anything - if (sample_infos != NULL) { - forwarder->info_seq_.assign(sample_infos, sample_infos + count); - } - // Forward the call to the StorageStreamWriter implementation - forwarder->storage_stream_writer_->store( - forwarder->sample_seq_, - forwarder->info_seq_); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - StorageStreamWriter * stream_writer() - { - return storage_stream_writer_.get(); - } - -private: - std::shared_ptr storage_stream_writer_; - - std::vector sample_seq_; - std::vector info_seq_; -}; - -/** - * This generic forwarding wrapper class defines a store method that forwards a - * call to a native stream writer's store method to a C++ stream writer - * specialisation. - * Two template parameters: - * - NativeStreamWriterType: one of the native stream writer types defined - * in recordingservice_storagewriter.h. These types have to implement a - * store() method to store the samples. - * - NativeStoredType: the type passed in to the store() method. - */ -template -class StorageGenericStreamWriterForwarder : public NativeStreamWriterType { -public: - - StorageGenericStreamWriterForwarder( - StorageStreamWriter *stream_writer, - StorageWriter *storage_writer_parent) - : storage_stream_writer_( - stream_writer, - StorageStreamWriterDeleter(storage_writer_parent)) - { - } - - ~StorageGenericStreamWriterForwarder() - { - } - - static void store_fwd( - void *stream_writer_data, - const NativeStoredType **samples, - const RTI_RoutingServiceSampleInfo *sample_infos, - const int count) - { - try { - StorageGenericStreamWriterForwarder *forwarder = - static_cast( - stream_writer_data); - /* - * In the case of the generic stream writer forwarder, used for the - * built-in DDS discovery topics, we are not guaranteed that the - * stream writer will not be null. This can happen if the user - * doesn't override the default implementations, which return null. - * The user may not have interest in recording one or any of the - * topics. We should account for that case. - */ - if (forwarder->storage_stream_writer_.get() == NULL) { - return; - } - // Fill in internal vector with incoming samples - StorageStreamWriter::SamplePtr *untyped_samples = - (StorageStreamWriter::SamplePtr *) samples; - forwarder->sample_seq_.assign( - untyped_samples, - untyped_samples + count); - /* - * Fill in internal vector with incoming sample infos, the sample - * info array is optional so check for validity before doing - * anything - */ - if (sample_infos != NULL) { - forwarder->info_seq_.assign(sample_infos, sample_infos + count); - } - // Forward the call to the StorageStreamWriter implementation - forwarder->storage_stream_writer_->store( - forwarder->sample_seq_, - forwarder->info_seq_); - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - StorageStreamWriter * stream_writer() - { - return storage_stream_writer_.get(); - } - -private: - std::shared_ptr storage_stream_writer_; - - std::vector sample_seq_; - std::vector info_seq_; - -}; - -class StorageParticipantWriterForwarder : - public StorageGenericStreamWriterForwarder< - RTI_RecordingServiceStorageParticipantWriter, - DDS_ParticipantBuiltinTopicData> { -public: - - StorageParticipantWriterForwarder( - StorageStreamWriter *stream_writer, - StorageWriter *storage_writer_parent) : - StorageGenericStreamWriterForwarder< - RTI_RecordingServiceStorageParticipantWriter, - DDS_ParticipantBuiltinTopicData>( - stream_writer, - storage_writer_parent) - { - store = store_fwd; - stream_writer_data = this; - } -}; - -class StoragePublicationWriterForwarder : - public StorageGenericStreamWriterForwarder< - RTI_RecordingServiceStoragePublicationWriter, - DDS_PublicationBuiltinTopicData> { -public: - - StoragePublicationWriterForwarder( - StorageStreamWriter *stream_writer, - StorageWriter *storage_writer_parent) : - StorageGenericStreamWriterForwarder< - RTI_RecordingServiceStoragePublicationWriter, - DDS_PublicationBuiltinTopicData>( - stream_writer, - storage_writer_parent) - { - store = store_fwd; - stream_writer_data = this; - } -}; - -class StorageSubscriptionWriterForwarder : - public StorageGenericStreamWriterForwarder< - RTI_RecordingServiceStorageSubscriptionWriter, - DDS_SubscriptionBuiltinTopicData> { -public: - - StorageSubscriptionWriterForwarder( - StorageStreamWriter *stream_writer, - StorageWriter *storage_writer_parent) : - StorageGenericStreamWriterForwarder< - RTI_RecordingServiceStorageSubscriptionWriter, - DDS_SubscriptionBuiltinTopicData>( - stream_writer, - storage_writer_parent) - { - store = store_fwd; - stream_writer_data = this; - } -}; - -} } } } // rti::recording::storage::detail - -#endif // RTI_RECORDING_STORAGE_DETAIL_STORAGE_STREAM_WRITER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageWriterForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageWriterForwarder.hpp deleted file mode 100644 index 64895dfca..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/recording/storage/detail/StorageWriterForwarder.hpp +++ /dev/null @@ -1,270 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_RECORDING_STORAGE_DETAIL_STORAGE_WRITER_FORWARDER_HPP_ -#define RTI_RECORDING_STORAGE_DETAIL_STORAGE_WRITER_FORWARDER_HPP_ - -#include -#include - -#include "log/log_common.h" -#include "rti/routing/detail/ForwarderUtils.hpp" -#include "rti/routing/ServiceProperty.hpp" - -#include "recordingservice/recordingservice_storagewriter.h" -#include "rti/recording/storage/StorageDefs.hpp" -#include "rti/recording/storage/detail/StorageStreamWriterForwarder.hpp" - -namespace rti { namespace recording { namespace storage { namespace detail { - -class StorageWriterForwarder : public RTI_RecordingServiceStorageWriter { -public: - - StorageWriterForwarder(StorageWriter *storage_writer) : - storage_writer_(storage_writer) - { - // User-data stream creation function - create_stream_writer = StorageWriterForwarder::create_stream_writer_fwd; - // Discovery stream creation functions - create_participant_writer = - StorageWriterForwarder::create_participant_writer_fwd; - create_publication_writer = - StorageWriterForwarder::create_publication_writer_fwd; - create_subscription_writer = - StorageWriterForwarder::create_subscription_writer_fwd; - // User-data stream deletion function - delete_stream_writer = StorageWriterForwarder::delete_stream_writer_fwd; - // Discovery stream deletion functions - delete_participant_writer = - StorageWriterForwarder::delete_participant_writer_fwd; - delete_publication_writer = - StorageWriterForwarder::delete_publication_writer_fwd; - delete_subscription_writer = - StorageWriterForwarder::delete_subscription_writer_fwd; - // Delete storage writer instance method - delete_instance = StorageWriterForwarder::delete_instance_fwd; - - storage_writer_data = this; - } - - ~StorageWriterForwarder() - { - } - - static void delete_instance_fwd( - struct RTI_RecordingServiceStorageWriter *storage_writer) - { - try { - StorageWriterForwarder *forwarder = - static_cast(storage_writer); - delete forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static RTI_RecordingServiceStorageStreamWriter * create_stream_writer_fwd( - void *storage_writer, - const RTI_RoutingServiceStreamInfo *native_stream_info, - const RTI_RoutingServiceProperties *native_properties) - { - RTI_CHECK_PRECONDITION(!rti::recording::is_discovery_stream( - std::string(native_stream_info->stream_name))); - try { - StorageWriterForwarder *forwarder = - static_cast(storage_writer); - rti::routing::StreamInfo stream_info(*native_stream_info); - rti::routing::PropertySet properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - StorageStreamWriterForwarder *stream_writer_forwarder = - new StorageStreamWriterForwarder( - forwarder->storage_writer_->create_stream_writer( - stream_info, - properties), - forwarder->storage_writer_.get()); - return stream_writer_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return NULL; - } - - static RTI_RecordingServiceStorageParticipantWriter * - create_participant_writer_fwd(void *storage_writer) - { - try { - StorageWriterForwarder *forwarder = - static_cast(storage_writer); - StorageParticipantWriterForwarder *stream_writer_forwarder = - new StorageParticipantWriterForwarder( - forwarder->storage_writer_->create_participant_writer(), - forwarder->storage_writer_.get()); - return stream_writer_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return NULL; - } - - static RTI_RecordingServiceStoragePublicationWriter * - create_publication_writer_fwd(void *storage_writer) - { - try { - StorageWriterForwarder *forwarder = - static_cast(storage_writer); - StoragePublicationWriterForwarder *stream_writer_forwarder = - new StoragePublicationWriterForwarder( - forwarder->storage_writer_->create_publication_writer(), - forwarder->storage_writer_.get()); - return stream_writer_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return NULL; - } - - static RTI_RecordingServiceStorageSubscriptionWriter * - create_subscription_writer_fwd(void *storage_writer) - { - try { - StorageWriterForwarder *forwarder = - static_cast(storage_writer); - StorageSubscriptionWriterForwarder *stream_writer_forwarder = - new StorageSubscriptionWriterForwarder( - forwarder->storage_writer_->create_subscription_writer(), - forwarder->storage_writer_.get()); - return stream_writer_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - return NULL; - } - - static void delete_stream_writer_fwd( - void *, - RTI_RecordingServiceStorageStreamWriter *storage_stream_writer) - { - try { - StorageStreamWriterForwarder *stream_writer_forwarder = - static_cast( - storage_stream_writer); - delete stream_writer_forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static void delete_participant_writer_fwd( - void *, - RTI_RecordingServiceStorageParticipantWriter *stream_writer) - { - try { - StorageParticipantWriterForwarder *forwarder = - static_cast( - stream_writer); - delete forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static void delete_publication_writer_fwd( - void *, - RTI_RecordingServiceStoragePublicationWriter *stream_writer) - { - try { - StoragePublicationWriterForwarder *forwarder = - static_cast( - stream_writer); - delete forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - - static void delete_subscription_writer_fwd( - void *, - RTI_RecordingServiceStorageSubscriptionWriter *stream_writer) - { - try { - StorageSubscriptionWriterForwarder *forwarder = - static_cast( - stream_writer); - delete forwarder; - } catch (const std::exception& ex) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - ex.what()); - } catch (...) { - RecorderPrint_exception( - &RTI_LOG_ANY_s, - "unknown exception"); - } - } - -private: - - std::shared_ptr storage_writer_; - -}; - -} } } } // rti::recording::storage::namespace - -#endif // RTI_RECORDING_STORAGE_DETAIL_STORAGE_WRITER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/EntityListener.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/EntityListener.hpp deleted file mode 100644 index f376d4725..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/EntityListener.hpp +++ /dev/null @@ -1,426 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ENTITY_LISTENER_HPP_ -#define RTI_ROUTING_ENTITY_LISTENER_HPP_ - -#include "routingservice/routingservice_service_impl.h" - -#include -#include -#include - -namespace rti { namespace routing { - -/** - */ -struct EntityKind_def { - /** - * @brief The underlying \p enum type - */ - enum type { - SERVICE = RTI_ROUTING_SERVICE_SERVICE_ENTITY, - DOMAIN_ROUTE = RTI_ROUTING_SERVICE_DOMAIN_ROUTE_ENTITY, - CONNECTION = RTI_ROUTING_SERVICE_CONNECTION_ENTITY, - SESSION = RTI_ROUTING_SERVICE_SESSION_ENTITY, - AUTO_TOPIC_ROUTE = RTI_ROUTING_SERVICE_AUTO_TOPIC_ROUTE_ENTITY, - TOPIC_ROUTE = RTI_ROUTING_SERVICE_TOPIC_ROUTE_ENTITY, - INPUT = RTI_ROUTING_SERVICE_INPUT_ENTITY, - OUTPUT = RTI_ROUTING_SERVICE_OUTPUT_ENTITY, - count_ - }; - -}; - -/** - */ -typedef dds::core::safe_enum EntityKind; - - -/** - */ -struct EntityStateKind_def { - /** - * @brief The underlying \p enum type - */ - enum type { - INVALID = RTI_SERVICE_INVALID_ENTITY_STATE, - ENABLED = RTI_SERVICE_ENABLED_ENTITY_STATE, - DISABLED = RTI_SERVICE_DISABLED_ENTITY_STATE, - STARTED = RTI_SERVICE_STARTED_ENTITY_STATE, - STOPPED = RTI_SERVICE_STOPPED_ENTITY_STATE, - RUNNING = RTI_SERVICE_RUNNING_ENTITY_STATE, - PAUSED = RTI_SERVICE_PAUSED_ENTITY_STATE - }; - -}; - -typedef dds::core::safe_enum EntityStateKind; - -/* - * @brief string representation of EntityStateKind - */ -inline -const std::string to_string(const rti::routing::EntityStateKind& kind) -{ - static const char * ENTITY_STATE_KIND_AS_STRING[] = { - "INVALID", - "ENABLED", - "DISABLED", - "STARTED", - "STOPPED", - "RUNNING", - "PAUSED" - }; - - return ENTITY_STATE_KIND_AS_STRING[kind.underlying()]; -} - -inline -const char* to_action_native_string(const rti::routing::EntityStateKind& kind) -{ - static const char * ENTITY_STATE_ACTION_AS_STRING[] = { - "INVALID", - "ENABLE", - "DISABLE", - "START", - "STOP", - "RUN", - "PAUSE" - "" - }; - - return ENTITY_STATE_ACTION_AS_STRING[kind.underlying()]; -} - -inline -const std::string to_action_string(const rti::routing::EntityStateKind& kind) -{ - return to_action_native_string(kind); -} - -class EntityListener { -public: - - class Context { - public: - - friend EntityListener::Context from_native( - RTI_RoutingServiceEntityListenerContext*); - - const rti::routing::EntityKind& entity_kind() const - { - return entity_kind_; - } - - const std::string& entity_name() const - { - return entity_name_; - } - - const rti::routing::EntityStateKind& entity_state_kind() const - { - return entity_state_kind_; - } - - bool ok() - { - return ok_; - } - - rti::advlog::Entries logging_context_entries() - { - return logging_context_entries_; - } - - private: - - rti::routing::EntityKind entity_kind_; - - std::string entity_name_; - - rti::routing::EntityStateKind entity_state_kind_; - - bool ok_; - - /* - * We need to keep the entries of the context because they are entered - * in a function and left in another function. - * The number of entries is two: - * - An entry for the resource. - * - An entry for the activity. - * - * Recorder: - * - The entries are entered into the context using the macro - * RTI_ENTITY_LISTENER_CONTEXT_ENTER_ON_BEFORE in a function. - * - The entries are left using the macro - * RTI_ENTITY_LISTENER_CONTEXT_LEAVE_ON_AFTER in another function. - * - * For example: - * - Enter in EntityListener::on_before_create - * - Leave in EntityListener::on_after_create - */ - rti::advlog::Entries logging_context_entries_; - }; - - virtual void on_before_create( EntityListener::Context&) - { - } - - virtual void on_after_create(EntityListener::Context&) - { - } - - virtual void on_before_state_change(EntityListener::Context&) - { - } - - virtual void on_after_state_change(EntityListener::Context&) - { - } - - virtual void on_before_delete(EntityListener::Context&) - { - } - - virtual void on_after_delete(EntityListener::Context&) - { - } - - virtual void on_before_stream_event( - EntityListener::Context&, - const rti::routing::StreamInfo&) - { - } - - virtual void on_after_stream_event( - EntityListener::Context&, - const rti::routing::StreamInfo&) - { - } - - virtual ~EntityListener() {} - -}; - - inline - EntityListener::Context from_native( - RTI_RoutingServiceEntityListenerContext *native) - { - EntityListener::Context context; - context.entity_kind_ = static_cast ( - native->entity_kind); - context.entity_name_ = native->entity_name; - context.entity_state_kind_ = static_cast ( - native->entity_state_kind); - context.ok_ = native->ok ? true : false; - context.logging_context_entries_.from_native( - native->logging_context_entries, - native->logging_context_params); - - return context; - } - -class EntityListenerForwarder { -public: - - typedef RTI_RoutingServiceEntityListener native; - - static native create( - EntityListener *listener) - { - native native_listener = RTI_RoutingServiceEntityListener_INITIALIZER; - native_listener.on_before_create = - on_before_create_forwarder; - native_listener.on_after_create = - on_after_create_forwarder; - native_listener.on_before_state_change = - on_before_state_change_forwarder; - native_listener.on_after_state_change = - on_after_state_change_forwarder; - native_listener.on_before_delete = - on_before_delete_forwarder; - native_listener.on_after_delete = - on_after_delete_forwarder; - native_listener.on_before_stream_event = - on_before_stream_event_forwarder; - native_listener.on_after_stream_event = - on_after_stream_event_forwarder; - native_listener.listener_data = static_cast(listener); - - return native_listener; - } - -private: - static void on_before_create_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_before_create(context); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } - static void on_after_create_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_after_create(context); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } - - static void on_before_state_change_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_before_state_change(context); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } - - static void on_after_state_change_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_after_state_change(context); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } - - static void on_before_delete_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_before_delete(context); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } - - static void on_after_delete_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_after_delete(context); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } - - static void on_before_stream_event_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native, - const RTI_RoutingServiceStreamInfo *stream_info) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_before_stream_event( - context, - *stream_info); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } - - static void on_after_stream_event_forwarder( - void *listener_data, - RTI_RoutingServiceEntityListenerContext *context_native, - const RTI_RoutingServiceStreamInfo *stream_info) - { - EntityListener *listener = - static_cast(listener_data); - try { - EntityListener::Context context = - rti::routing::from_native(context_native); - listener->on_after_stream_event( - context, - *stream_info); - } catch (rti::apputils::ServiceException& ex) { - SERVICELog_fromException(ex); - } catch (std::exception& ex) { - SERVICELog_exception(&RTI_LOG_ANY_s, ex.what()); - } catch (...) { - SERVICELog_exception(&RTI_LOG_UNEXPECTED_EXCEPTION); - } - } -}; - -}} - - - - - -#endif // RTI_ROUTING_ENTITY_LISTENER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/Logger.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/Logger.hpp deleted file mode 100644 index 45ea0577f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/Logger.hpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_LOGGER_HPP_ -#define RTI_ROUTING_LOGGER_HPP_ - -#include -#include - -#include "routingservice/routingservice_log.h" -#include "routingservice/routingservice_service.h" - -namespace rti { namespace routing { - - -/** \ingroup RTI_RoutingServiceLibModule - * - * @brief The singleton type used to configure @product verbosity - * - * For configuring other aspects such as output file, print format or - * RTI Connext specific logging, use rti::config::Logger. - */ -class Logger -{ -public: - - typedef rti::config::Verbosity Verbosity; - typedef rti::config::LogCategory LogCategory; - typedef rti::config::PrintFormat PrintFormat; - - static Logger& instance() - { - static Logger singleton; - return singleton; - } - - /** - * @brief Sets the verbosity for the log messages generated at the - * @product level. - * - * @param verbosity - * @rs_st_in The verbosity of the service logs - */ - void service_verbosity(rti::config::Verbosity verbosity) - { - NDDS_Config_Logger_set_verbosity_by_service( - NDDS_Config_Logger_get_instance(), - NDDS_CONFIG_LOG_SERVICE_ROUTING, - static_cast(verbosity.underlying())); - } - - /** - * @brief Getter for the same attribute - * - * @see service_verbosity(rti::config::Verbosity) - */ - rti::config::Verbosity service_verbosity() - { - RTILogBitmap instrumentation_mask = - NDDS_Config_Logger_get_verbosity_by_service( - NDDS_Config_Logger_get_instance(), - NDDS_CONFIG_LOG_SERVICE_ROUTING); - - return static_cast(instrumentation_mask); - } - - /** - * @brief Logs as message with EXCEPTION level - * - * The generated log will be part of logging stream of the running service - * if the service verbosity contains EXCEPTION messages. The result log - * message may include additional information according to the - * Connext logging configuration, such as Advlog Context, thread ID, - * line number, etc. Additionally, the result log message will contain a - * newline character at the end, so the format does not need to contain it. - * - * @param[in] msg Message to be logged - */ - void error(const std::string& msg) - { - this->error(msg.c_str()); - } - - /** - * @brief overload of error(const std::string& msg) - */ - void error(const char *msg) - { - this->message(rti::config::LogLevel::EXCEPTION, msg); - } - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * WARNING. - * - * @param[in] msg Message to be logged - * - * @see rti::routing::Logger::error - * - */ - void warn(const std::string& msg) - { - this->warn(msg.c_str()); - } - - /** - * @brief overload of warn(const std::string& msg) - */ - void warn(const char *msg) - { - this->message(rti::config::LogLevel::WARNING, msg); - } - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_LOCAL. - * - * @param[in] msg Message to be logged - * - * @see rti::routing::Logger::error - * - */ - void local(const std::string& msg) - { - this->local(msg.c_str()); - } - - /** - * @brief overload of local(const std::string& msg) - */ - void local(const char *msg) - { - this->message(rti::config::LogLevel::STATUS_LOCAL, msg); - } - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_REMOTE. - * - * @param[in] msg Message to be logged - * - * @see rti::routing::Logger::error - * - */ - void remote(const std::string& msg) - { - this->remote(msg.c_str()); - } - - /** - * @brief overload of remote(const std::string& msg) - */ - void remote(const char *msg) - { - this->message(rti::config::LogLevel::STATUS_REMOTE, msg); - } - - /** - * @brief Logs as message with WARNING level - * - * This operation behaves similar to error() except the log level is - * STATUS_DEBUG. - * - * @param[in] msg Message to be logged - * - * @see rti::routing::Logger::error - * - */ - void debug(const std::string& msg) - { - this->debug(msg.c_str()); - } - - /** - * @brief overload of debug(const std::string& msg) - */ - void debug(const char *msg) - { - this->message(rti::config::LogLevel::STATUS_ALL, msg); - } - - virtual ~Logger() - { - } - -private: - - void message(const rti::config::LogLevel& level, const char* msg) - { - RTI_RoutingServiceLogger_log( - static_cast (level.underlying()), - "%s", - msg); - } - - Logger() - { - } - // Disable copy - Logger(const Logger&); - Logger& operator=(const Logger&); -}; - -}} - -#endif // RTI_ROUTING_LOGGER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/PropertySet.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/PropertySet.hpp deleted file mode 100644 index 55030941b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/PropertySet.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROPERTY_SET_HPP_ -#define RTI_ROUTING_PROPERTY_SET_HPP_ - -#include - -#include "routingservice/routingservice_infrastructure.h" -#include - -namespace rti { namespace routing { - -inline -std::string app_name_property_name() -{ - return RTI_ROUTING_SERVICE_APP_NAME_PROPERTY_NAME; -} - -inline -std::string group_name_property_name() -{ - return RTI_ROUTING_SERVICE_GROUP_PROPERTY_NAME; -} - -inline -std::string version_property_name() -{ - return RTI_ROUTING_SERVICE_VERSION_PROPERTY_NAME; -} - -inline -std::string verbosity_property_name() -{ - return RTI_ROUTING_SERVICE_VERBOSITY_PROPERTY_NAME; -} - -inline -std::string entity_resource_name_property_name() -{ - return RTI_ROUTING_SERVICE_ENTITY_RESOURCE_NAME_PROPERTY_NAME; -} -/** @ingroup RTI_RoutingServiceInfrastructureModule - * - * @brief The definition of a pluggable entity’s configuration properties. - * - * Configuration properties for an entity are obtained as a result of parsing - * the <property> corresponding to each pluggable entity. The result is a - * map keyed by property name, represented as std::string, whose values are - * the property values, also represented as std::string. Hence, a property name - * shall be unique for each set of entity properties. - */ -typedef std::map PropertySet; - -}} - -#endif // RTI_ROUTING_PROPERTY_SET_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/RoutingService.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/RoutingService.hpp deleted file mode 100644 index ef672fab7..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/RoutingService.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ROUTING_SERVICE_HPP_ -#define RTI_ROUTING_ROUTING_SERVICE_HPP_ - -#include - - -#endif // RTI_ROUTING_ROUTING_SERVICE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/Service.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/Service.hpp deleted file mode 100644 index 9ec28767e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/Service.hpp +++ /dev/null @@ -1,404 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_SERVICE_HPP_ -#define RTI_ROUTING_SERVICE_HPP_ - -#include -#include - -#include "routingservice/routingservice_adapter_new.h" - -#include -#include -#include -#include -#include - -namespace rti { namespace routing { - -/*e \defgroup RTI_RoutingServiceLibModule RTI Routing Library API - * \ingroup ROUTER - * - * @brief @product can be deployed as a native library linked into your - * application in select architectures. - * - * This API allows you to create, configure and start @product instances from - * your application. - * - * The following code shows the typical use of the API: - * - * \code - * - * int main () - * { - * rti::routing::Service service( - * rti::routing::ServiceProperty() - * .cfg_file("MyRouter.xml") - * .cfg_name("MyRouter")); - * ... - * - * service.start(); - * - * while(keep_running) { - * sleep(); - * ... - * } - * - * return 0; - * } - * - * \endcode - * - * Instead of a file, you can use XML strings to configure @product. - * See ServiceProperty for more information. - *

- * To build your application you need to link with the @product native library - * in <@ndds home>/bin/<architecture>/ . - * - * ### Development Requirements - * - * | | Linux/macOS Systems | Windows Systems | - * | --------------: | :----------------: | :-------------: | - * | Shared Libraries| libnddscpp2.so | nddscpp2.dll | - * | ^ | librtirsinfrastructure.so | rtirsinfrastructure.dll | - * | ^ | librtiserviceadmincpp.so | rtiserviceadmincpp.dll | - * | ^ | librtidlc.so | rtidlc.dll | - * | ^ | librtiapputilsc.so | rtiapputilsc.dll | - * | ^ | libnddsmetp.so | nddsmetp.dll | - * | ^ | librticonnextmsgc.so | rticonnextmsgc.dll | - * | ^ | libnddsc.so | nddsc.dll | - * | ^ | librtixml2.so | rtixml2.dll | - * | ^ | libnddscore.so | nddscore.dll | - * | Headers | rti/routing/RoutingService.hpp || - * - */ - -/** \ingroup RTI_RoutingServiceLibModule - * - * @brief The @product. - * - */ -class Service : public dds::core::Reference { -public: - - typedef RTI::Service::Admin::CommandRequest CommandRequest; - typedef RTI::Service::Admin::CommandReply CommandReply; - - typedef dds::core::Reference Base; - OMG_DDS_REF_TYPE_NOTYPENAME( - Service, - dds::core::Reference, - RoutingServiceImpl); - - /** - * @brief Creates a @product instance - * - * @param property - * @rs_st_in The property to configure @product instance. - * - * @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks): - * UNSAFE for multiple threads to simultaneously make the FIRST - * call to any of the Service constructors. Subsequent calls are - * thread safe. - * On Windows and Linux systems, these calls are thread-safe. - */ - explicit Service(const ServiceProperty& property) - : Base(new RoutingServiceImpl(property)) - { - this->delegate()->remember_reference(this->delegate()); - } - - /** - * @brief Creates a @product instance - * - * A callable shutdown hook can optionally be provided to handle the - * shutdown command received through remote administration. Upon reception - * of this command, @product will notify the installed hook. - * - * The following example shows simple implementation of a shutdown hook - * that sets a boolean flag to true when invoked: - * - * \code - * - * // Hook implementation - * struct FlagShutdownHook { - * public: - * FlagShutdownHook(bool& the_flag) : flag(the_flag) { - * flag = false; - * } - * void operator()() { - * flag = true; - * } - * - * bool& flag; - * }; - * - * // Instantiate service with hook - * bool my_flag; - * FlagShutdownHook my_hook(my_flag) - * rti::routing::Service routing_service( - * property, - * my_hook); - * ... - * - * - * \endcode - * - * - * @param[in] property - * The property to configure @product instance. - * - * @param[in] shutdown_hook - * Callable object to handle the shutdown command. The expected - * type is a void operator()() (C++11 equivalent is - * std::function) - * - * @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks): - * UNSAFE for multiple threads to simultaneously make the FIRST - * call to any of the Service constructors. Subsequent calls are - * thread safe. - * On Windows and Linux systems, these calls are thread-safe. - */ - template - Service( - const ServiceProperty& property, - HookFunc& shutdown_hook) - : Base(new RoutingServiceImpl(property, shutdown_hook)) - { - this->delegate()->remember_reference(this->delegate()); - } - - Service(const RTI_RoutingServiceProperty& property) - : Base(new RoutingServiceImpl(property)) - { - this->delegate()->remember_reference(this->delegate()); - } - - explicit Service(Base::DELEGATE_REF_T reference) : Base(reference) - { - if (this->delegate()) { - this->delegate()->remember_reference(this->delegate()); - } - } - - /** - * @brief Starts @product. - * - * This is a non-blocking operation. @product will create its own set of - * threads to perform its tasks. - */ - void start() - { - this->delegate()->start(); - } - - /** - * @brief Stops @product. - * - * This operation will bloc the instance is fully stopped. - */ - void stop() - { - this->delegate()->stop(); - } - - /** - * @brief Attaches an Adapter plugin to be used by @product when it is - * started. - * - * By using this function an adapter can be statically compiled, created - * in your application and have the service load it, instead of registering - * a shared library and a create function in the configuration. - * - * The name passed in this function is the name that has to be used in the - * configuration to instantiate connections from the plugin. - * - * Example: - * - * \code - * - * rti::routing::RoutingService service(property); - * - * service.attach_adapter_plugin(myAdapter, "MyAdapter"); - * - * service.start(); - * ... - * - * \endcode - * - * And our configuration would look like this: - * - * \code - * - * - * - * - * - * - * ... - * - * - * ... - * - * - * - * - * \endcode - * - * This function can be called as many times as desired to attach - * several plugins. - * - * @pre Routing Service must not be started - * - * @param adapter_plugin - * @rs_st_in The adapter plugin object to be attached. The object - * shall remain alive during the execution of the service. Once the - * plugin is attached, the memory is owned by @product and will delete - * it upon service stop. - * - * @param plugin_name - * @rs_st_in - * The name used for this plugin in the <connection> - * tag in the configuration. - * - */ - void attach_adapter_plugin( - rti::routing::adapter::AdapterPlugin *adapter_plugin, - const std::string& plugin_name) - { - this->delegate()->attach_adapter_plugin( - adapter_plugin, - plugin_name); - } - - /** - * @brief Attaches a Processor plugin to be used by @product when it is - * started. - * - * @see attach_adapter_plugin - */ - void attach_processor_plugin( - rti::routing::processor::ProcessorPlugin *processor_plugin, - const std::string& plugin_name) - { - this->delegate()->attach_processor_plugin( - processor_plugin, - plugin_name); - } - - /** - * @brief Attaches a Transformation plugin to be used by @product when it - * is started. - * - * @see attach_adapter_plugin - */ - void attach_transformation_plugin( - rti::routing::transf::TransformationPlugin *transformation_plugin, - const std::string& plugin_name) - { - this->delegate()->attach_transformation_plugin( - transformation_plugin, - plugin_name); - } - - /** - * @brief Executes an Administration command on this service. - * - * This operation directly executes the specified \p request in this - * service as if it was directly received from an administration requester. - * - * The request can represent any of the available administration operations - * as documented in the Administration chapter in the user's manual. This - * operation gives you an alternative way to control the service using - * the same remote administration interface but allowing you to call - * the operation directly. - * - * This operation can also throw an exception if an internal error - * occurs. - * - * Example: - * - * \code - * - * using namespace rti::routing; - * using namespace RTI::Service; - * using namespace RTI::Service::Admin; - * - * // Instantiate a RoutingServicee - * RoutingService service(...); - * - * // Prepare a request for any command, for example stop the service - * CommandRequest request; - * request.action(CommandActionKind::UPDATE_ACTION); - * request.resource_identifier("/routing_services/MyRouter"); - * dds::topic::topic_type_support::to_cdr_buffer( - * reinterpret_cast &>(request.octet_body()), - * EntityState(EntityStateKind::DISABLED)); - * // Execute and check result - * CommandReply reply = service.execute_command(request); - * if (reply.retcode().underlying() != CommandReplyRetcode::OK_RETCODE) { - * Logger.instance().error( - * std::string("Command returned: ") + reply.string_body()); - * //handle - * ... - * } - * - * \endcode - * - * @param[in] request Representation of the command to be executed - * @return The reply with the result of the command execution. - * - */ - CommandReply execute_command(const CommandRequest& request) - { - return this->delegate()->execute_command(request); - } - - /** - * @brief Executes an Administration command on this service. - * - * Similar to execute_command(const CommandRequest& request) except - * the caller provides the CommandReply object. - * - * @param[out] reply Representation of the reply containing the result of - * the operation - * @param[in] request Representation of the command to be executed - * - * @return A reference to the same reply object provided as a parameter - */ - CommandReply& execute_command( - CommandReply& reply, - const CommandRequest& request) - { - return this->delegate()->execute_command(reply, request); - } - - /** - * @deprecated Calling this function at the end of the application is no - * longer necessary. It will be removed in future versions. - */ - static void finalize_globals() - { - rti::routing::Logger::instance().warn( - "Calling 'rti::routing::Service::finalize_globals()' is no " - "longer necessary and the function will be removed in future " - "versions"); - } - -}; - -typedef Service RoutingService; - -}} - -#endif // RTI_ROUTING_SERVICE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/ServiceProperty.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/ServiceProperty.hpp deleted file mode 100644 index c6164f03c..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/ServiceProperty.hpp +++ /dev/null @@ -1,563 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ROUTING_SERVICE_PROPERTY_HPP_ -#define RTI_ROUTING_ROUTING_SERVICE_PROPERTY_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include -#include - -#include "routingservice/routingservice_service.h" -#include - -namespace rti { namespace routing { - -class PropertyAdapter { -public: - typedef RTI_RoutingServiceProperty native_type; - - static void initialize(native_type& native_value) - { - static const native_type DEFAULT - = RTI_RoutingServiceProperty_INITIALIZER; - native_value = DEFAULT; - native_value.service_verbosity = -1; - native_value.dds_verbosity = -1; - } - - static void finalize(native_type& native_value) - { - if (native_value.cfg_strings != NULL) { - RTIOsapiHeap_freeArray(native_value.cfg_strings); - native_value.cfg_strings = NULL; - } - - RTI_RoutingServiceProperty_finalize(&native_value); - } - - static void copy(native_type& destination, const native_type& source) - { - RTIOsapiUtility_unusedParameter(destination); - RTIOsapiUtility_unusedParameter(source); - - throw dds::core::UnsupportedError("Unsupported operation: copy"); - } - - static bool equals(const native_type& first, const native_type& second) - { - RTIOsapiUtility_unusedParameter(first); - RTIOsapiUtility_unusedParameter(second); - - throw dds::core::UnsupportedError("Unsupported operation: equals"); - } - - static void add_properties_from_native( - std::map& properties, - const RTI_RoutingServiceProperties *native_properties) - { - for (int i = 0; i < native_properties->count; i++) { - properties[native_properties->properties[i].name] = - (const char *) native_properties->properties[i].value; - } - } - - static void add_properties_to_native( - RTI_RoutingServiceProperties *native_properties, - const std::map& properties) - { - RTI_RoutingServiceProperties_finalize(native_properties); - RTI_RoutingServiceProperties_initialize(native_properties); - - std::map::const_iterator it = properties.begin(); - for (; it != properties.end(); ++it) { - if (!RTI_RoutingServiceProperties_add( - native_properties, - it->first.c_str(), - it->second.c_str())) { - throw dds::core::Error("failed to add native property"); - } - } - } - -}; - -class ServiceProperty; - -} - -namespace core { - -template<> -struct native_type_traits { - typedef rti::routing::PropertyAdapter adapter_type; - typedef RTI_RoutingServiceProperty native_type; -}; - -} - -namespace routing { - -/** \ingroup RTI_RoutingServiceLibModule - * - * @brief Configuration for a @product object. - * - */ -class ServiceProperty : public rti::core::NativeValueType { -public: - RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(ServiceProperty) - - typedef rti::core::NativeValueType Base; - - /** - * @brief Creates a property object with default settings. - */ - ServiceProperty(): Base() - { - } - - ServiceProperty(const struct RTI_RoutingServiceProperty &native_property) - : Base(native_property) - { - } - - - /** - * @brief Getter (see setter with the same name) - */ - std::string cfg_file() const - { - return native().cfg_file == NULL ? "" : native().cfg_file; - } - - /** - * @brief Path to an @product configuration file - * - * @default empty string. - */ - ServiceProperty& cfg_file(const std::string& filename) - { - DDS_String_replace( - &native().cfg_file, - filename.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - const std::vector& cfg_strings() const - { - return cfg_strings_; - } - - /** - * @brief XML configuration represented as strings - * - * An array of strings that altogether make up an - * XML document to configure @product. This parameter is used - * only if ServiceProperty::cfg_file is empty. - * - * The reason for using an array instead of one single string is to - * get around the limited size of literal strings. - * In general, if you create the XML string dynamically - * the vector needs only one element. - * - * @default empty. - */ - ServiceProperty& cfg_strings( - const std::vector& the_cfg_strings) - { - cfg_strings_ = the_cfg_strings; - if (cfg_strings_.size() > 0) { - if (!RTIOsapiHeap_reallocateArray( - (char ***) &native().cfg_strings, - cfg_strings_.size(), - char *)) { - throw dds::core::OutOfResourcesError("cfg_strings native array"); - } - for (uint32_t i = 0; i < cfg_strings_.size(); i++) { - native().cfg_strings[i] = cfg_strings_[i].c_str(); - } - } - native().cfg_strings_count = static_cast(cfg_strings_.size()); - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string service_name() const - { - return native().service_name == NULL ? "" : native().service_name; - } - - /** - * @brief The name of the @product configuration to run. - * - * This is the name used to find the <routing_service> - * XML tag in the configuration file; the name that will - * be used to refer to this execution in remote administration and - * monitoring. - * - * @default empty string. - */ - ServiceProperty& service_name(const std::string& name) - { - DDS_String_replace( - &native().service_name, - name.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string application_name() const - { - return native().application_name; - } - - /** - * @brief Assigns a name to the execution of the @product. - * - * Remote commands and status information will refer to the service using - * this name. - * - * In addition, the name of DomainParticipants created by @product will be - * based on this name. - * - * @default empty string. - * If no application name is specified, @product will use - * ServiceProperty::service_name. - * - */ - ServiceProperty& application_name(const std::string& name) - { - DDS_String_replace( - &native().application_name, - name.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enforce_xsd_validation() const - { - return (native().enforce_xsd_validation == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Controls whether the service applies XSD validation to the loaded - * configuration. - * - * @default true - */ - ServiceProperty& enforce_xsd_validation(const bool enforce_xsd_validation) - { - native().enforce_xsd_validation = enforce_xsd_validation; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int domain_id_base() const - { - return native().domain_id_base; - } - - /*e - * @brief Value that is added to the domain IDs of the - * domain routes in the XML configuration. - * - * By using this, an XML file can use relative domain IDs. - * - * @default 0 - */ - ServiceProperty& domain_id_base(const int domain_id) - { - native().domain_id_base = domain_id; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string plugin_search_path() const - { - return native().plugin_search_path == NULL - ? "" - : native().plugin_search_path; - } - - /** - * @brief This path is used to look for plugin libraries. - * - * If the plugin class libraries specified in the XML file don't - * contain a full path, @product looks for them in this - * directory if not NULL. - * - * @default "." (working directory) - */ - ServiceProperty& plugin_search_path(const std::string& path) - { - DDS_String_replace( - &native().plugin_search_path, - path.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool dont_start_service() const - { - return (native().dont_start_service == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Set this to true to if you do not want @product enabled when - * RoutingServcie::start is called. - * - * @product can be enabled afterwards through remote administration. - * - * @default false - */ - ServiceProperty& dont_start_service(const bool not_start) - { - native().dont_start_service = not_start - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enable_administration() const - { - return (native().enable_administration == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Set this to true to enable remote administration - * or false to disable it. - * - * @default false - */ - ServiceProperty& enable_administration(const bool enable) - { - native().enable_administration = enable - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int administration_domain_id() const - { - return native().administration_domain_id; - } - - /** - * @brief If ServiceProperty::enable_administration is true, this is - * the domain ID to use for remote administration. - * - * Takes precedence over the XML configuration. - * If ServiceProperty::enable_administration is false, this value is not used - * even if remote administration is enabled in the XML configuration. - * - * @default 0 - */ - ServiceProperty& administration_domain_id(const int domain_id) - { - native().administration_domain_id = domain_id; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool enable_monitoring() const - { - return native().enable_monitoring == DDS_BOOLEAN_TRUE - ? true - : false; - } - - /** - * @brief Set it to true to enable remote monitoring - * or false to disable it. - * - * @default false - */ - ServiceProperty& enable_monitoring(const bool& enable) - { - native().enable_monitoring = enable - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - int monitoring_domain_id() const - { - return native().monitoring_domain_id; - } - - /** - * @brief If ServiceProperty::enable_monitoring is true, this is - * the domain ID to use for remote monitoring. - * - * Takes precedence over the XML configuration. - * If ServiceProperty::enable_monitoring is false, this value is not used, - * even if remote monitoring is enabled in the XML configuration. - * - * @default 0 - */ - ServiceProperty& monitoring_domain_id(const int& domain_id) - { - native().monitoring_domain_id = domain_id; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - bool skip_default_files() const - { - return (native().skip_default_files == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Set it to true to avoid loading the - * standard files usually loaded by @product. - * - * Only the configuration in ServiceProperty::cfg_file or - * ServiceProperty::cfg_strings will be loaded. - * - * @default false - */ - ServiceProperty& skip_default_files(const bool& skip) - { - native().skip_default_files = skip - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - - /** - * @brief Getter (see setter with the same name) - */ - bool identify_execution() const - { - return (native().identify_execution == DDS_BOOLEAN_TRUE) - ? true - : false; - } - - /** - * @brief Set this to true to append the host name and process ID - * to the @product execution name. - * - * Used to get unique names for remote administration and monitoring. - * - * @default false - */ - ServiceProperty& identify_execution(const bool& identify) - { - native().identify_execution = identify - ? DDS_BOOLEAN_TRUE - : DDS_BOOLEAN_FALSE; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string license_file_name() const - { - return native().license_file_name == NULL? "" - : native().license_file_name; - } - - /** - * @brief Path to an @product license file. - * - * If not empty, this file is checked for a valid license; otherwise, - * default location will be used. This parameter is only used if your - * installation requires a license file. - * - * @default empty string. - */ - ServiceProperty& license_file_name(const std::string& filename) - { - DDS_String_replace( - &native().license_file_name, - filename.c_str()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::map user_environment() const - { - std::map properties; - - PropertyAdapter::add_properties_from_native( - properties, - &native().user_environment); - - return properties; - } - - /** - * @brief Dictionary of user variables. - * The dictionary provides a parallel way to expand XML configuration - * variables in the form $(my_var), when they are not defined in the - * environment. - * - * @default empty - */ - ServiceProperty& user_environment( - const std::map& user_environment) - { - rti::routing::PropertyAdapter::add_properties_to_native( - &native().user_environment, - user_environment); - - return *this; - } - -private: - std::vector cfg_strings_; -}; - -}} - -#endif // RTI_ROUTING_ROUTING_SERVICE_PROPERTY_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/StreamInfo.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/StreamInfo.hpp deleted file mode 100644 index 853f72419..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/StreamInfo.hpp +++ /dev/null @@ -1,210 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_STREAM_INFO_HPP_ -#define RTI_ROUTING_ADAPTER_STREAM_INFO_HPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - - -#include -#include -#include -#include -#include - -namespace rti { namespace routing { - -/** @ingroup RTI_RoutingServiceInfrastructureModule - * - */ - -class StreamInfoAdapter { -public: - typedef RTI_RoutingServiceStreamInfo native_type; - - static void initialize(native_type& native_value) - { - RTIOsapiMemory_zero( - &native_value, - sizeof (RTI_RoutingServiceStreamInfo)); - } - - static void finalize(native_type& native_value) - { - TypeInfoAdapter::finalize(native_value.type_info); - if (native_value.stream_name != NULL) { - DDS_String_free(native_value.stream_name); - native_value.stream_name = NULL; - } - } - - static void copy(native_type& destination, const native_type& source) - { - char *result = DDS_String_replace( - &destination.stream_name, - source.stream_name); - if (source.stream_name != NULL && result == NULL) { - throw std::bad_alloc(); - } - destination.disposed = source.disposed; - TypeInfoAdapter::copy( - destination.type_info, - source.type_info); - } - - static bool equals(const native_type& first, const native_type& second) - { - if (strcmp(first.stream_name, second.stream_name) != 0) { - return false; - } - if (first.disposed != second.disposed) { - return false; - } - return TypeInfoAdapter::equals(first.type_info, second.type_info); - } - -}; - -class StreamInfo; - -} - -// native_type_traits needs to be defined in rti::core -namespace core { - -template <> -struct native_type_traits { - typedef rti::routing::StreamInfoAdapter adapter_type; - typedef RTI_RoutingServiceStreamInfo native_type; -}; - -} - -namespace routing { - -/** @ingroup RTI_RoutingServiceInfrastructureModule - * - * @class rti::routing::StreamInfo - * - * @brief Definition of the stream information that @product needs to manage - * user data streams. - * - * A stream in @product is a typed data channel to consume/produce data - * in a data domain. - * - */ -class StreamInfo : public rti::core::NativeValueType { -public: - RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(StreamInfo) - - typedef rti::core::NativeValueType Base; -public: - - /** - * @brief Constructs a StreamInfo with the minimum required information. - * - * @param the_stream_name - * @rs_st_in The name of the stream. - * @param the_type_name - * @rs_st_in The name of the type associated with the data in the - * stream. - */ - StreamInfo( - const std::string& the_stream_name, - const std::string& the_type_name) - { - stream_name(the_stream_name); - type_info().type_name(the_type_name); - } - - StreamInfo(const RTI_RoutingServiceStreamInfo &native_stream_info) - : Base(native_stream_info) - { - } - - /** - * @brief Getter (see setter with the same name) - */ - bool disposed() const - { - return native().disposed ? true : false; - } - - /** - * @brief Sets the dispose flag in this object. - * - * Indicates whether the stream is a newly discovered stream or a - * disposed stream that no longer exists. - * - * @param the_disposed - * @rs_st_in true if the stream is marked as disposed or false - * otherwise. - */ - StreamInfo& disposed(bool the_disposed) - { - native().disposed = the_disposed ? 1 : 0; - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string stream_name() const - { - return native().stream_name; - } - - /** - * @brief Sets the name of the stream - * - * @param the_stream_name - * @rs_st_in Name of the stream. - */ - StreamInfo& stream_name(const std::string& the_stream_name) - { - if (DDS_String_replace( - &native().stream_name, - the_stream_name.c_str()) == NULL) { - throw std::bad_alloc(); - } - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - TypeInfo& type_info() - { - using namespace rti::core::native_conversions; - - return cast_from_native(native().type_info); - } - - /** - * @brief Sets the type information associated with the stream. - * - * @see TypeInfo. - */ - const TypeInfo& type_info() const - { - using namespace rti::core::native_conversions; - - return cast_from_native(native().type_info); - } - -}; - -}} - -#endif // RTI_ROUTING_ADAPTER_STREAM_INFO_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/TypeInfo.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/TypeInfo.hpp deleted file mode 100644 index 14d05a08e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/TypeInfo.hpp +++ /dev/null @@ -1,322 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_TYPE_INFOHPP_ -#define RTI_ROUTING_ADAPTER_TYPE_INFOHPP_ - -// IMPORTANT: macros.hpp must be the first RTI header included in every header -// file so that symbols are exported correctly on Windows -#include - -#include -#include -#include -#include -#include - -namespace rti { namespace routing { - -/** - * @ingroup RTI_RoutingServiceInfrastructureModule - * - */ - -/** @ingroup RTI_RoutingServiceInfrastructureModule - * - * @class TypeRepresentationKind_def - * - * @brief The definition of the rti::routing::TypeRepresentationKind - * - * The range [0-100] is reserved for RTI use. Within that range are some - * predefined type representations. - * - */ -struct TypeRepresentationKind_def { - /** - * @brief Definition of all the possible type representation kinds - */ - enum type { - /** - * @brief Dynamic type representation. - * - * Types with this representation are provided as \ndds TypeCodes. - * - * For more information about TypeCodes, see Chapter 3 in the - * RTI Core Libraries and Utilities User's Manual. - */ - DYNAMIC_TYPE = RTI_ROUTING_SERVICE_TYPE_REPRESENTATION_DYNAMIC_TYPE, - /** - * @brief @not_supported XML type representation. - * - * Types with this representation are provided as XML strings. - * The XML schema is the \ndds XML schema for type representation. - * - * For more information about XML representation, - * see Chapter 3 in the RTI Core Libraries and Utilities User's Manual. - */ - XML = RTI_ROUTING_SERVICE_TYPE_REPRESENTATION_XML, - /** - * @brief @not_supported Java object type representation. - * - * Types with this representation are provided as Java objects. - */ - JAVA_OBJECT = RTI_ROUTING_SERVICE_TYPE_REPRESENTATION_JAVA_OBJECT, - /** - * @brief @not_supported Custom type representation. - * - * Types with this representation are specific to a concrete - * adapter implementation - */ - CUSTOM = RTI_ROUTING_SERVICE_TYPE_REPRESENTATION_FIRST_CUSTOM_REPRESENTATION - }; -}; - -/** @ingroup RTI_RoutingServiceInfrastructureModule - * - * @class TypeRepresentationKind - * - * @brief valid type representations that @product accepts. - * - * @see rti::routing::TypeRepresentationKind_def - */ -typedef dds::core::safe_enum TypeRepresentationKind; - - -class TypeInfoAdapter { -public: - typedef RTI_RoutingServiceTypeInfo native_type; - - static void initialize(native_type& native_value) - { - static const native_type default_value = { - NULL, - DDS_BOOLEAN_TRUE, - RTI_ROUTING_SERVICE_TYPE_REPRESENTATION_DYNAMIC_TYPE, - NULL}; - native_value = default_value; - } - - static void finalize(native_type& native_value) - { - if (native_value.type_name != NULL) { - RTIOsapiHeap_freeString(native_value.type_name); - native_value.type_name = NULL; - } - } - - static void copy(native_type& destination, const native_type& source) - { - char *result = DDS_String_replace( - &destination.type_name, - source.type_name); - if (source.type_name != NULL && result == NULL) { - throw std::bad_alloc(); - } - destination.can_be_optimized = source.can_be_optimized; - destination.type_representation_kind = - source.type_representation_kind; - destination.type_representation = - source.type_representation; - } - - static bool equals(const native_type& first, const native_type& second) - { - if (strcmp(first.type_name, second.type_name) != 0) { - return false; - } - if (first.type_representation_kind - != second.type_representation_kind) { - return false; - } - - return first.type_representation == second.type_representation; - } - -}; - -class TypeInfo; - -} - -// native_type_traits needs to be defined in rti::core -namespace core { - -template <> -struct native_type_traits { - typedef rti::routing::TypeInfoAdapter adapter_type; - typedef RTI_RoutingServiceTypeInfo native_type; -}; - -} - -namespace routing { - -/** @ingroup RTI_RoutingServiceInfrastructureModule - * - * @class rti::routing::TypeInfo - * - * @brief Definition of the type information associated with a @product - * stream. - * - * @see StreamInfo. - * - */ -class TypeInfo : public rti::core::NativeValueType { -public: - RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(TypeInfo) - - typedef rti::core::NativeValueType Base; - - /** - * @brief Type representation defined as an opaque pointer. - * - * How this opaque is interpreted depends on the TypeRepresentationKind. - */ - typedef RTI_RoutingServiceTypeRepresentation TypeRepresentationType; -public: - - /** - * @brief Constructs a TypeInfo with the minimum required information. - * - * @param the_type_name - * @rs_st_in Registered name of the type associated with the data. - * @param the_type_representation_kind - * @rs_st_in Indicates the representation of the object that - * describes the type. Default: TypeRepresentationKind::DYNAMIC_TYPE. - */ - TypeInfo( - const std::string& the_type_name, - TypeRepresentationKind the_type_representation_kind = - TypeRepresentationKind::DYNAMIC_TYPE) - { - type_name(the_type_name); - type_representation_kind(the_type_representation_kind); - native().can_be_optimized = DDS_BOOLEAN_TRUE; - } - - TypeInfo(const struct RTI_RoutingServiceTypeInfo &native_stream_info) - : Base(native_stream_info) - { - } - - /** - * @brief Getter (see setter with the same name) - */ - std::string type_name() const - { - return native().type_name; - } - - /** - * @brief Sets the registered name of the type associated with the data. - * - * @product uses the type name to provide the right type information to - * StreamReader and StreamWriter. Namely, a type match is performed by - * comparing this type name with the value specified in the tag - * <registered_type_name> within the <input> and <output> - * tags. - */ - TypeInfo& type_name(const std::string& the_type_name) - { - - if (DDS_String_replace( - &native().type_name, - the_type_name.c_str()) == NULL) { - throw std::bad_alloc(); - } - - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - TypeRepresentationKind type_representation_kind() const - { - return static_cast( - native().type_representation_kind); - } - - /** - * @brief Sets the type representation kind. - * - * This member indicates how to interpret the type representation. - * - * @see TypeRepresentationKind - */ - TypeInfo& type_representation_kind( - TypeRepresentationKind the_type_representation_kind) - { - native().type_representation_kind = static_cast( - the_type_representation_kind.underlying()); - return *this; - } - - /** - * @brief Getter (see setter with the same name) - */ - TypeRepresentationType type_representation() const - { - return native().type_representation; - } - - /** - * @brief Sets the type representation value. - * - * This member is defined as an opaque pointer that can hold any type - * representation. How to interpret this pointer is determined by the - * TypeRepresentationKind, which shall be consistent with the object set - * in this member. - */ - TypeInfo& type_representation(TypeRepresentationType the_type_representation) - { - native().type_representation = the_type_representation; - return *this; - } - - /** - * @brief Returns the type_representation as DynamicType object - * - * The operation throws if type_representation_kind is not DYNAMIC_TYPE - * - */ - const dds::core::xtypes::DynamicType& dynamic_type() const - { - if (type_representation_kind() != TypeRepresentationKind::DYNAMIC_TYPE) { - throw dds::core::IllegalOperationError( - "type representation is not dynamic type"); - } - - const DDS_TypeCode *native_typecode = reinterpret_cast( - type_representation()); - return rti::core::native_conversions::cast_from_native< - dds::core::xtypes::DynamicType>(*native_typecode); - } - - /** - * @brief Sets the type representation value as DynamicType object - * - * The provided DynamicType pointer must point to an object that remains - * valid until the StreamInfo object is destroyed. - * - * @see type_representation(TypeRepresentationType the_type_representation) - */ - void dynamic_type(const dds::core::xtypes::DynamicType *dynamic_type) - { - DDS_TypeCode *native_typecode = const_cast( - reinterpret_cast(dynamic_type)); - type_representation(static_cast(native_typecode)); - type_representation_kind(TypeRepresentationKind::DYNAMIC_TYPE); - } -}; - -}} - -#endif // RTI_ROUTING_ADAPTER_TYPE_INFOHPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/UpdatableEntity.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/UpdatableEntity.hpp deleted file mode 100644 index 78760fd3b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/UpdatableEntity.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_UPDATABLE_ENTITY_HPP_ -#define RTI_ROUTING_UPDATABLE_ENTITY_HPP_ - -#include -#include - -namespace rti { namespace routing { - -/** @ingroup RTI_RoutingServiceInfrastructureModule - * - * @class rti::routing::UpdatableEntity - * - * @brief Defines a common interface for all the pluggable entities that can - * be updated at runtime. - * - * @product allows to update an pluggable entity through remote administration. - * - * @mtsafety Safe - * The UpdatableEntity::update operation is called only for one - * entity at a time. Additionally, no other operations can be made - * concurrently on a pluggable entity during the - * UpdatableEntity::update call. - */ -class UpdatableEntity { -public: - - /** - * @brief Updates a pluggable entity. - * - * @param properties - * @rs_st_in The new configuration properties, obtained as result - * of parsing the elements within the <property> tag - * corresponding to the entity being updated. - */ - virtual void update(const std::map& properties) - { - (void) properties; - } - - /** - * @brief Virtual destructor. - */ - virtual ~UpdatableEntity() - { - } -}; - -}} - -#endif // RTI_ROUTING_UPDATABLE_ENTITY_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/AdapterPlugin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/AdapterPlugin.hpp deleted file mode 100644 index 3495c0ae2..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/AdapterPlugin.hpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_ADAPTER_HPP_ -#define RTI_ROUTING_ADAPTER_ADAPTER_HPP_ - -#include - -#include "routingservice/routingservice_infrastructure.h" -#include -#include -#include - -/** @file - * @brief \product C++ Adapter API - */ - -namespace rti { namespace routing { namespace adapter { - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::AdapterPlugin - * @brief The top-level plug-in class. - * - * Represents a factory of Connection. - */ -class AdapterPlugin { -public: - /** - * @brief Creates a Connection. - * - * Connection objects are created when the domain routes that contain them - * are enabled. - * - * @param input_stream_discovery_listener - * @rs_st_in The listener of the built-in @ref DiscoveryStreamReader - * that notifies the discovery of new input streams. - * @param output_stream_discovery_listener - * @rs_st_in The listener of the built-in @ref DiscoveryStreamReader - * that notifies the discovery of new output streams. - * @param properties - * @rs_st_in Configuration properties for the Connection. - * These properties corresponds to the properties specified within - * the tag <connection>. - * - * @return New Connection if successful. Cannot return @null_value. - * - * @throw std::exception - * - * @mtsafety Safe - */ - virtual Connection * create_connection( - StreamReaderListener *input_stream_discovery_listener, - StreamReaderListener *output_stream_discovery_listener, - const PropertySet& properties) = 0; - - /** - * @brief Deletes a Connection. - * - * Connection objects are deleted when the domain routes that contain them - * are disabled or @product is stopped. - * - * @param connection @rs_st_in Connection to be deleted - * - * @throw std::exception - * - * @mtsafety Safe - */ - virtual void delete_connection(Connection *connection) = 0; - - /** - * @return The version of this AdapterPlugin. - * - * Version is used for logging purposes and allows you to track which - * version of the AdapterPlugin @product is using. - * - *Default implementation of this operation returns the version of the - * required Connext libraries. - */ - virtual rti::config::LibraryVersion get_version() const - { - return rti::config::LibraryVersion(); - } - - /** - * @brief Virtual destructor - */ - virtual ~AdapterPlugin() {} -}; - -}}} - -#include - - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @brief Utility macro that declares a native extern function that can - * be used to load an AdapterPlugin through a shared library. - * - * The prototype of the function is given by - * RTI_RoutingServiceAdapterPlugin_CreateFcn. - * - * To register an AdapterPlugin plugin with @product, you must use the tag - * <adapter_plugin> within <plugin_library>. For example: - * - * \code - * - * ... - * - - mycadapter - - MyAdapterPlugin_create - - - * ... - * - * ... - * - * ... - * - * ... - * - * \endcode - * - * Once an AdapterPlugin is registered, a Connection can refer to it as - * follows: - * - * For example: - * - * \code - * - * - * - * - * - * - * - * - * my_property_name - * my_property_value - * - * - * - * - * - * ... - * - * - * - * \endcode - * - * For additional information on configuring adapters, see the - * \ref_url_routing_service_users_manual. - * - * @param ADAPTER_CLASS - * Class name of an AdapterPlugin implementation - */ -#define RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DECL(ADAPTER_CLASS) \ -extern "C" RTI_USER_DLL_EXPORT struct RTI_RoutingServiceAdapterPluginExt * \ - ADAPTER_CLASS ## _create_adapter_plugin(\ - const struct RTI_RoutingServiceProperties *, \ - RTI_RoutingServiceEnvironment *); \ - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @brief Utility macro that implements the AdapterPlugin entry point declared - * with RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DECL. - */ -#define RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DEF(ADAPTER_CLASS) \ -struct RTI_RoutingServiceAdapterPluginExt * ADAPTER_CLASS ## _create_adapter_plugin( \ - const struct RTI_RoutingServiceProperties * native_properties, \ - RTI_RoutingServiceEnvironment *environment) \ -{ \ - PropertySet properties; \ - rti::routing::PropertyAdapter::add_properties_from_native(\ - properties,\ - native_properties); \ - try { \ - return rti::routing::adapter::detail::AdapterForwarder::create_plugin(new ADAPTER_CLASS(properties)); \ - } catch (const std::exception& ex) {\ - RTI_RoutingServiceEnvironment_set_error(\ - environment,\ - "%s",\ - ex.what());\ - } catch (...) {}\ - \ - return NULL; \ -} - - - - -#endif // RTI_ROUTING_ADAPTER_ADAPTER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Connection.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Connection.hpp deleted file mode 100644 index dbd332286..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Connection.hpp +++ /dev/null @@ -1,263 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_CONNECTION_HPP_ -#define RTI_ROUTING_ADAPTER_CONNECTION_HPP_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace rti { namespace routing { namespace adapter { - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::Connection - * - * @brief A Connection provides access to a data domain (such as a DDS domain - * or a JMS network provider). - * - * In the XML configuration file, Connections are associated with the tag - * <connection> within a domain route. - */ -class Connection : public UpdatableEntity { - -public: - /** - * @brief Creates a Session - * - * Session objects are created when the associated @product Sessions are - * enabled. This operation is called once for each service Session and - * for each Connection within the DomainRoute. - * - * @param properties - * @rs_st_in Configuration properties for the Session. - * - * @return New Session if successful. Can return @null_value if sessions - * are not required by this AdapterPlugin. - * - * @throw std::exception - * - * - * @mtsafety Safe - * - */ - virtual Session * create_session( - const PropertySet& properties) - { - (void) properties; - - return NULL; - } - - /** - * @brief Deletes a Session - * - * Session objects are deleted when the @product Sessions that contain them - * are disabled. - * - * @param session - * @rs_st_in Session to be deleted. - * - * @throw std::exception - * @mtsafety Safe - */ - virtual void delete_session(Session *session) - { - (void) session; - } - - /** - * @brief Creates a StreamWriter. - * - * This @method is called for each Route's output when the associated - * 'creation mode' condition is met. The operation is called on the output - * Connection as a specified through the 'connection' attribute in the - * <output> tag. - * - * @param session - * @rs_st_in Session associated with the StreamWriter. This - * parameter is \null_value if Sessions are not used by the adapter. - * @param stream_info - * @rs_st_in Information related to the stream where the StreamWriter - * sends data. - * @param properties - * @rs_st_in Configuration properties for the StreamWriter. - * - * @return New StreamWriter if successful. Cannot return @null_value - * - * @throw std::exception - * @mtsafety Partially Safe. - * This operation is never called concurrently for the same - * Connection, even if multiple outputs are configured in different - * Sessions. It can only be called concurrently for different - * Connections. - * - */ - virtual StreamWriter * create_stream_writer( - Session *session, - const StreamInfo& stream_info, - const PropertySet& properties) - { - (void) session; - (void) stream_info; - (void) properties; - - return NULL; - } - - /** - * @brief Deletes a StreamWriter. - * - * A StreamWriter object is deleted when: - * - The route that contains it is disabled - * - The 'creation mode' condition associated with the route's output - * becomes false - * - \product is shutdown. - * - * @param stream_writer - * @rs_st_in StreamWriter to be deleted. - * - * @throw std::exception - */ - virtual void delete_stream_writer( - StreamWriter *stream_writer) - { - (void) stream_writer; - } - - /** - * @brief Creates a StreamReader. - * - * This @method is called for each Route's input when the associated - * 'creation mode' condition is met. The operation is called on the input - * Connection as a specified through the 'connection' attribute in the - * <output> tag. - * - * @param session - * @rs_st_in Session associated with the StreamReader. This - * parameter is \null_value if Sessions are not used by the adapter. - * @param stream_info - * @rs_st_in Information related to the stream where the StreamReader - * read data. - * @param properties - * @rs_st_in Configuration properties for the StreamReader. - * @param listener - * @rs_st_in The listener for the StreamReader implementation used - * to notify \product when new data is available. - * - * @return New StreamReader if successful. Cannot return @null_value. - * - * @throw std::exception - * - * @mtsafety Partially Safe. - * This operation is never called concurrently for the same - * Connection, even if multiple outputs are configured in different - * Sessions. It can only be called concurrently for different - * Connections. - * - */ - virtual StreamReader * create_stream_reader( - Session *session, - const StreamInfo& stream_info, - const PropertySet& properties, - StreamReaderListener *listener) - { - (void) session; - (void) stream_info; - (void) properties; - (void) listener; - - return NULL; - } - - /** - * @brief Deletes a StreamReader. - * - * A StreamReader object is deleted when: - * - The route that contains it is disabled - * - The 'creation mode' condition associated with the route's input - * becomes false - * - \product is shutdown. - * - * @param stream_reader - * @rs_st_in StreamReader to be deleted. - * - * @throw std::exception - */ - virtual void delete_stream_reader( - StreamReader *stream_reader) - { - (void) stream_reader; - } - - /** - * @brief Gets the input stream discovery StreamReader. - * - * Returns a DiscoveryStreamReader that is used by \product to discover - * input streams. - * - * An input stream is a stream from which a StreamReader can read data. - * Disposed scenarios, where an input stream disappears, are also notified - * using this DiscoveryStreamReader. - * - * The StreamReaderListener associated with this DiscoveryStreamReader is - * provided as a parameter to the method AdapterPlugin::create_connection - * - * Implementations may return @null_value if they do not support stream - * discovery. - * - * @throw std::exception - */ - virtual DiscoveryStreamReader * input_stream_discovery_reader() - { - return NULL; - } - - /** - * @brief Gets the output stream discovery StreamReader. - * - * Returns a DiscoveryStreamReader that is used by \product to discover - * output streams. - * - * An output stream is a stream from which a StreamWrite can write data. - * Disposed scenarios, where an output stream disappears, are also notified - * using this DiscoveryStreamReader. - * - * The StreamReaderListener associated with this DiscoveryStreamReader is - * provided as a parameter to the method AdapterPlugin::create_connection. - * - * Implementations may return @null_value if they do not support stream - * discovery. - * - * @throw std::exception - */ - virtual DiscoveryStreamReader * output_stream_discovery_reader() - { - return NULL; - } - - /** - * @brief Virtual destructor - */ - virtual ~Connection() - { - } - -}; - -}}} - -#endif // RTI_ROUTING_ADAPTER_CONNECTION_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/DiscoveryStreamReader.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/DiscoveryStreamReader.hpp deleted file mode 100644 index 062bbe810..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/DiscoveryStreamReader.hpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DISCOVERY_STREAM_READER_HPP_ -#define RTI_ROUTING_ADAPTER_DISCOVERY_STREAM_READER_HPP_ - -#include - -#include -#include -#include - - -namespace rti { namespace routing { namespace adapter { - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::DiscoveryStreamReader - * - * @brief Definition of a special StreamReader to read information about - * data streams. - * - * @mtsafety Safe - * All the operations on a DiscoveryStreamReader always serialized, - * no matter from which Connection it belongs. - */ -class DiscoveryStreamReader : public StreamReader{ - - using StreamReader::take; - using StreamReader::return_loan; - /** - * @brief Performs the conversion between the vector of data - * pointers to strongly-type pointers. - */ - void take( - std::vector& sample_seq, - std::vector&) RTI_FINAL - { - take(sample_seq_); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq, sample_seq_); - } - - /** - * @brief Performs the conversion between the vector of data - * pointers to strongly-type pointers. - */ - void return_loan( - std::vector& sample_seq, - std::vector&) RTI_FINAL - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq_, sample_seq); - return_loan(sample_seq_); - sample_seq_.clear(); - } - - void read( - std::vector&, - std::vector&) RTI_FINAL - { - } - - void take( - std::vector&, - std::vector&, - const SelectorState&) RTI_FINAL - { - } - - void read( - std::vector&, - std::vector&, - const SelectorState&) RTI_FINAL - { - } - - virtual void* create_content_query( - void *, - const dds::topic::Filter&) RTI_FINAL - { - return NULL; - } - - - virtual void delete_content_query(void*) RTI_FINAL - { - - } - - -public: - - /** - * @brief Takes a collection of all available StreamInfo samples. - * - * When \product is done using the samples, it will 'return the loan' to the - * DiscoveryStreamReader by calling DiscoveryStreamReader::return_loan. - * It is guaranteed \product takes one outstanding loan at time. - * - * The samples provided with this operation are considered 'removed' - * from the DiscoveryStreamReader's cache, and they shall no longer be - * returned by subsequent DiscoveryStreamReader::take. - * - * @param sample_seq - * @rs_st_inout Vector that will hold the StreamInfo samples. \product - * provides this vector to the StreamReader to fill. For each call, - * the size of the vector is zero. - * @throw std::exception - */ - virtual void take( - std::vector& sample_seq) = 0; - - /** @brief Returns a loan on the read or taken StreamInfo samples. - * - * \product calls this method to indicate that it is done accessing - * the collection of StreamInfo samples obtained by an earlier - * invocation of DiscoveryStreamReader::take. - * - * @param sample_seq - * @rs_st_in Vector of loaned data samples. - * - * @throw std::exception - */ - virtual void return_loan( - std::vector& sample_seq) = 0; - - /* - * @brief Virtual destructor - */ - virtual ~DiscoveryStreamReader() - { - } - -private: - std::vector sample_seq_; -}; - -}}} - -#endif // RTI_ROUTING_ADAPTER_DISCOVERY_STREAM_READER_HPP_ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Session.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Session.hpp deleted file mode 100644 index 8282dc183..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/Session.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ -#ifndef RTI_ROUTING_ADAPTER_SESSION_HPP_ -#define RTI_ROUTING_ADAPTER_SESSION_HPP_ - -#include - -namespace rti { namespace routing { namespace adapter { - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::Session - * - * A Session is a concurrency unit within a Connection that has an associated - * set of StreamReaders and StreamWriter. Access to the StreamReader and - * StreamWriters in the same Session is serialized by @product. - * - * In the XML configuration file, Sessions are associated with the tag - * <session> within a DomainRoute. - */ -class Session : public UpdatableEntity { - -public: - - /** - * @brief Virtual destructor - */ - virtual ~Session() - { - } -}; - -}}} - -#endif // RTI_ROUTING_ADAPTER_SESSION_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReader.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReader.hpp deleted file mode 100644 index 15a202494..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReader.hpp +++ /dev/null @@ -1,666 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_STREAM_READER_HPP_ -#define RTI_ROUTING_ADAPTER_STREAM_READER_HPP_ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace rti { namespace routing { namespace adapter { - -class SelectorState; - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::StreamReader - * - * @brief Provides a way to read samples of a specific type from a data domain. - * In the XML configuration file, StreamReaders are associated with the tag - * <input> within <route> and <auto_route>. - * - * @mtsafety Partially Safe - * All operations on a concrete StreamReader objects are safe and - * always serialized on a given Session. Operations on different - * StreamReader objects can be called concurrently if the - * StreamReader objects belong to different Sessions. - */ -class StreamReader : public UpdatableEntity{ - -public: - typedef void* SamplePtr; - typedef void* InfoPtr; - - /** - * @brief Takes a collection of all data samples and info samples available - * from an input stream. - * - * When \product is done using the samples, it will 'return the loan' to the - * StreamReader by calling StreamReader::return_loan. Note that multiple - * calls to this operation can be made before returning the loans. - * - * The samples provided with this operation are considered 'removed' - * from the StreamReader cache, and they shall no longer be returned by - * subsequent StreamReader::take or StreamReader::read operations. - * - * This operation represents the minimum required behavior by \product - * in order to forward data. - * - * @param sample_seq - * @rs_st_inout Vector that will hold the output samples. \product - * provides this vector to the StreamReader to fill. For each call, - * the size of the vector is zero. - * The data representation associated with the samples will be given - * by the value of TypeInfo::data_representation_kind that is - * part of the StreamInfo object passed at StreamWriter creation - * time. - * Usually the data representation is dynamic type, which corresponds - * to dds::core::xtypes::DynamicData. - * @param info_seq - * @rs_st_inout Vector that will hold the output info samples. \product - * provides this vector to the StreamReader to fill. For each call, - * the size of the vector is zero. - * The implementation may leave the vector untouched if it does not - * support the concept of sample info. - * The info representation is dependent of the StreamWriter - * implementation. - * Usually when data representation is dynamic type, the sample - * info is dds::sub::SampleInfo. - * - * @throw std::exception - */ - virtual void take( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /** - * @brief Variation of StreamReader::take where the returned samples will - * remain in the StreamReader's cache, so they can be read again by - * subsequence StreamReader::take or StreamReader::read operations. - * - * @see StreamReader::take - */ - virtual void read( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /** - * @brief Variation of StreamReader::take where the returned samples shall - * represent the subset specified by the SelectorState. - * - * SelectorState is configured accordingly from the values set on - * rti::routing::processor::Selector. This operation will be called only - * by custom rti::routing::processor::Processor implementations. - * - * @param sample_seq - * @param info_seq - * @param selector_state - * @rs_st_in A description of the subset of samples that shall - * be returned. - * - * @see SelectorState. - */ - virtual void take( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector_state) = 0; - - /** - * @brief Variation of StreamReader::read where the returned samples shall - * represent the subset specified by the SelectorState. - * - * SelectorState is configured accordingly from the values set on - * rti::routing::processor::Selector. This operation will be called only - * by custom rti::routing::processor::Processor implementations. - * - * @param sample_seq - * @param info_seq - * @param selector_state - * @rs_st_in A description of the subset of samples that shall - * be returned. - * - * @see SelectorState. - */ - virtual void read( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector_state) = 0; - - /** - * @brief Returns a loan on the read or taken data samples and info samples. - * - * \product calls this method to indicate that it is done accessing - * the collection of data samples and info samples obtained by an earlier - * invocation of any variation of StreamReader::take. - * - * @param sample_seq - * @rs_st_in Vector of loaned data samples. - * @param info_seq - * @rs_st_in Vector of loaned info samples. - * - * @throw std::exception - * - */ - virtual void return_loan( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /** - * @brief Creates a query object that selects the data with the specified - * filter. - * - * This operation allows to read data with a SelectorState that contains - * a query object returned by this operation. - * - * A query object type is implementation dependent and it's guaranteed to - * to be used only within the same StreamReader that created it. Because - * a query object may be a expensive resource, this operation allows to - * receive a previously created query for a potential reuse and update of - * its filter. - * - * @param[in] old_query_data A previously created query object that - * that is provided for potential reuse and update of its filter. - * @param[in] filter The query content filter - * - * @return The new or updated query object. - * - * @throw std::exception - * - */ - virtual void* create_content_query( - void *old_query_data, - const dds::topic::Filter& filter) = 0; - - /** - * @brief Deletes a content query created from this StreamReader. - * - * @param[in] query_data the query object to be deleted. - */ - virtual void delete_content_query(void* query_data) = 0; - - /** - * @brief Virtual destructor. - */ - virtual ~StreamReader() - { - } - -}; - - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::TStreamReader - * - * @brief A wrapper implementation of a StreamReader that provides a - * strongly-typed interface through template parameters for data and info - * representation. - * - * You can implement this interface as a convenience to manipulate the data - * and info representation without dealing with opaque pointers. - */ -template -class TStreamReader : public StreamReader { - -public: - - /** - * @brief The data type - */ - typedef Data DataRep; - /** - * @brief The info type - */ - typedef Info InfoRep; - - using StreamReader::take; - using StreamReader::read; - using StreamReader::return_loan; - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - void take( - std::vector& sample_seq, - std::vector& info_seq) RTI_FINAL - { - take(sample_seq_, info_seq_); - convert_samples(sample_seq, info_seq); - } - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - void read( - std::vector& sample_seq, - std::vector& info_seq) RTI_FINAL - { - read(sample_seq_, info_seq_); - convert_samples(sample_seq, info_seq); - } - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - void take( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector_state) RTI_FINAL - { - take(sample_seq_, info_seq_, selector_state); - convert_samples(sample_seq, info_seq); - } - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - void read( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector_state) RTI_FINAL - { - read(sample_seq_, info_seq_, selector_state); - convert_samples(sample_seq, info_seq); - } - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - void return_loan( - std::vector& sample_seq, - std::vector& info_seq) RTI_FINAL - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq_, sample_seq); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(info_seq_, info_seq); - return_loan(sample_seq_, info_seq_); - sample_seq_.clear(); - info_seq_.clear(); - } - - /** - * @brief Interface redefinition - * - * @see StreamReader::take - */ - virtual void take( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /** - * @brief Interface redefinition - * - * @see StreamReader::read - */ - virtual void read( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /** - * @brief Interface redefinition - * - * @see StreamReader::take(std::vector&, std::vector&,const SelectorState&); - */ - virtual void take( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector_state) = 0; - - /** - * @brief Interface redefinition - * - * @see StreamReader::read(std::vector&, std::vector&,const SelectorState&); - */ - virtual void read( - std::vector& sample_seq, - std::vector& info_seq, - const SelectorState& selector_state) = 0; - - /** - * @brief Interface redefinition - * - * @see StreamReader::return_loan - */ - virtual void return_loan( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /* - * @brief Virtual destructor - */ - virtual ~TStreamReader() - { - - } - -private: - void convert_samples( - std::vector& sample_seq, - std::vector& info_seq) - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq, sample_seq_); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(info_seq, info_seq_); - } - -private: - std::vector sample_seq_; - std::vector info_seq_; - -}; - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::NoOpStreamReader - * - * @brief An empty implementation of the TStreamReader interface. - * - * Each implemented operation performs as a no-op. - */ -template -class NoOpStreamReader : public TStreamReader { - -public: - virtual void take( - std::vector&, - std::vector&) RTI_OVERRIDE - { - } - - virtual void read( - std::vector&, - std::vector&) RTI_OVERRIDE - { - } - - virtual void take( - std::vector&, - std::vector&, - const SelectorState&) RTI_OVERRIDE - { - } - - virtual void read( - std::vector&, - std::vector&, - const SelectorState&) RTI_OVERRIDE - { - } - - virtual void return_loan( - std::vector&, - std::vector&) RTI_OVERRIDE - { - } - - virtual void* create_content_query( - void *, - const dds::topic::Filter&) RTI_OVERRIDE - { - return NULL; - } - - - virtual void delete_content_query(void*) RTI_OVERRIDE - { - - } - - - - virtual ~NoOpStreamReader() - { - } - -}; - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @brief Convenient definition of typed StreamReader that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - * - */ -typedef NoOpStreamReader - DynamicDataStreamReader; - - - -class SelectorStateAdapter { -public: - typedef RTI_RoutingServiceSelectorState native_type; - - static void initialize(native_type& native_value) - { - RTI_RoutingServiceSelectorState native_state = - RTI_RoutingServiceSelectorState_INITIALIZER; - memcpy(&native_value, &native_state, sizeof(native_state)); - } - - static void finalize(native_type& native_value) - { - if (native_value.content.expression != NULL) { - DDS_String_free(native_value.content.expression); - } - DDS_StringSeq_finalize(&native_value.content.expression_parameters); - } - - static void copy(native_type& destination, const native_type& source) - { - destination.sample_state = source.sample_state; - destination.view_state = source.view_state; - destination.instance_state = source.instance_state; - destination.instance_handle = source.instance_handle; - destination.instance_selection = source.instance_selection; - destination.sample_count_max = source.sample_count_max; - destination.query_data = source.query_data; - char *result = DDS_String_replace( - &destination.content.expression, - source.content.expression); - if (source.content.expression != NULL && result == NULL) { - throw std::bad_alloc(); - } - if (DDS_StringSeq_copy( - &destination.content.expression_parameters, - &source.content.expression_parameters) == NULL) { - throw std::bad_alloc(); - } - } - - static bool equals(const native_type& first, const native_type& second) - { - if (first.sample_state != second.sample_state) { - return false; - } - if (first.view_state != second.view_state) { - return false; - } - if (first.instance_state != second.instance_state) { - return false; - } - if (first.instance_selection != second.instance_selection) { - return false; - } - if (first.sample_count_max != second.sample_count_max) { - return false; - } - if (first.query_data != second.query_data) { - return false; - } - if (first.content.expression != NULL - && second.content.expression != NULL - && strcmp(first.content.expression, second.content.expression) != 0) { - return false; - } - return DDS_StringSeq_equals( - &first.content.expression_parameters, - &second.content.expression_parameters); - } - -}; - -} } - -// native_type_traits needs to be defined in rti::core -namespace core { - -template <> -struct native_type_traits { - typedef rti::routing::adapter::SelectorStateAdapter adapter_type; - typedef RTI_RoutingServiceSelectorState native_type; -}; - -} - -namespace routing { namespace adapter { - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::SelectorState - * - * @brief Defines a set of attributes that can be used to read a subset of - * data from StreamReader. - * - * - * - */ -class SelectorState : public rti::core::NativeValueType { -public: - RTI_NATIVE_VALUE_TYPE_DEFINE_DEFAULT_MOVE_OPERATIONS(SelectorState) - - typedef rti::core::NativeValueType Base; -public: - SelectorState() - { - - } - - SelectorState(const RTI_RoutingServiceSelectorState &native) - : Base(native) - { - } - - dds::sub::status::DataState state() const - { - return dds::sub::status::DataState( - dds::sub::status::SampleState(native().sample_state), - dds::sub::status::ViewState(native().view_state), - dds::sub::status::InstanceState(native().instance_state)); - } - - SelectorState& state(const dds::sub::status::DataState& state) - { - native().sample_state = static_cast( - state.sample_state().to_ulong()); - native().view_state = static_cast( - state.view_state().to_ulong()); - native().instance_state = static_cast( - state.instance_state().to_ulong()); - return *this; - } - - int32_t max_samples() const - { - return native().sample_count_max; - } - - SelectorState& max_samples(const int32_t count) - { - native().sample_count_max = count; - return *this; - } - - dds::core::InstanceHandle instance() const - { - if (native().instance_selection - == RTI_ROUTING_SERVICE_THIS_INSTANCE_SELECTION) { - return rti::core::native_conversions::from_native_handle( - native().instance_handle); - } - - return dds::core::InstanceHandle::nil(); - } - - SelectorState& instance(const dds::core::InstanceHandle& handle) - { - native().instance_handle = - static_cast(handle->native()); - native().instance_selection = RTI_ROUTING_SERVICE_THIS_INSTANCE_SELECTION; - return *this; - } - - dds::core::InstanceHandle next_instance() const - { - if (native().instance_selection - == RTI_ROUTING_SERVICE_NEXT_INSTANCE_SELECTION) { - return rti::core::native_conversions::from_native_handle( - native().instance_handle); - } - - return dds::core::InstanceHandle::nil(); - } - - SelectorState& next_instance( - const dds::core::InstanceHandle& handle) - { - native().instance_handle = - static_cast(handle->native()); - native().instance_selection = RTI_ROUTING_SERVICE_NEXT_INSTANCE_SELECTION; - return *this; - } - - void* content() - { - return native().query_data; - } - - SelectorState& content(void *query_data) - { - native().query_data = query_data; - return *this; - } - - dds::topic::Filter filter() const - { - return dds::topic::Filter( - native().content.expression == NULL ? "" : native().content.expression, - rti::core::native_conversions::from_native( - native().content.expression_parameters)); - } - - SelectorState& filter(const dds::topic::Filter& filter) - { - DDS_String_replace( - &native().content.expression, - filter.expression().c_str()); - rti::core::native_conversions::to_native( - native().content.expression_parameters, - filter->parameters()); - return *this; - } - -}; - -}}} - -#endif // RTI_ROUTING_ADAPTER_STREAM_READER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReaderListener.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReaderListener.hpp deleted file mode 100644 index dc4fdf684..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamReaderListener.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_STREAM_READER_LISTENER_HPP_ -#define RTI_ROUTING_ADAPTER_STREAM_READER_LISTENER_HPP_ - -#include - -namespace rti { namespace routing { namespace adapter { - -using detail::StreamReaderListener; - -}}} - -#endif // RTI_ROUTING_ADAPTER_STREAM_READER_LISTENER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamWriter.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamWriter.hpp deleted file mode 100644 index 523669f4f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/StreamWriter.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_STREAM_WRITER_HPP_ -#define RTI_ROUTING_ADAPTER_STREAM_WRITER_HPP_ - -#include - -#include -#include - -namespace rti { namespace routing { namespace adapter { - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::StreamWriter - * - * @brief Provides a way to write samples of a specific type in a data domain. - * - * In the XML configuration file, A StreamWriter is associated with the tag - * <output> within <route> or <auto_route>. - * - * @mtsafety Partially Safe - * All operations on a concrete StreamWriter objects are safe and - * always serialized on a given Session. Operations on different - * StreamWriter objects can be called concurrently if the - * StreamWriter objects belong to different Sessions. - */ -class StreamWriter : public UpdatableEntity { - -public: - - typedef void* SamplePtr; - typedef void* InfoPtr; - - /** - * @brief Writes a collection of data samples to the output stream - * associated with this StreamWriter. - * - * @param sample_seq - * @rs_st_in Vector of sample pointers. - * The data representation associated with the samples will be given - * by the value of TypeInfo::data_representation_kind that is - * part of the StreamInfo object passed at StreamWriter creation - * time. - * Usually the data representation is dynamic type, which corresponds - * to dds::core::xtypes::DynamicData. - * @param info_seq - * @rs_st_in Vector of sample info pointers. - * The info representation is dependent of the StreamWriter - * implementation. - * Usually when data representation is dynamic type, the sample - * info is dds::sub::SampleInfo. - * @return Number of samples written. - * @throw std::exception - */ - virtual int write( - const std::vector& sample_seq, - const std::vector& info_seq) = 0; - - /** - * @brief Virtual destructor - */ - virtual ~StreamWriter() - { - } -}; - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::TStreamWriter - * - * @brief A wrapper implementation of a StreamWriter that provides a - * strongly-typed interface through template parameters for data and info - * representation. - * - * You can implement this interface as a convenience to manipulate the data - * and info representation without dealing with opaque pointers. - */ -template -class TStreamWriter : public StreamWriter { - -public: - - /** - * @brief The data type - */ - typedef Data DataRep; - typedef DataRep* DataRepPtr; - /** - * @brief The info type - */ - typedef Info InfoRep; - typedef InfoRep* InfoRepPtr; - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - int write( - const std::vector& sample_seq, - const std::vector& info_seq) RTI_FINAL - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq_, sample_seq); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(info_seq_, info_seq); - - return write(sample_seq_, info_seq_); - } - - /** - * @brief Interface redefinition - * - * @see StreamWriter::write - */ - virtual int write( - const std::vector& sample_seq, - const std::vector& info_seq) = 0; - - /** - * @brief Virtual destructor - */ - virtual ~TStreamWriter() - { - } - -private: - std::vector sample_seq_; - std::vector info_seq_; -}; - - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @brief Convenient definition of typed StreamWriter that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - * - */ -typedef TStreamWriter - DynamicDataStreamWriter; - -}}} - -#endif // RTI_ROUTING_ADAPTER_STREAM_WRITER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/AdapterForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/AdapterForwarder.hpp deleted file mode 100644 index 5124a4e52..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/AdapterForwarder.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_ADAPTER_FORWARDER_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_ADAPTER_FORWARDER_HPP_ - -#include - -#include - -#include - -namespace rti { namespace routing { namespace adapter { namespace detail { - - -class AdapterForwarder { -public: - static RTI_RoutingServiceAdapterPluginExt * create_plugin( - AdapterPlugin *adapter_plugin) - { - RTI_RoutingServiceAdapterPluginExt *native_adapter = NULL; - RTIOsapiHeap_allocateStructure( - &native_adapter, - struct RTI_RoutingServiceAdapterPluginExt); - rti::core::check_create_entity( - native_adapter, - "RTI_RoutingServiceAdapterPluginExt"); - RTI_RoutingServiceAdapterPluginExt_initialize(native_adapter); - - // Set adapter version - rti::config::LibraryVersion version = adapter_plugin->get_version(); - native_adapter->plugin_version.major = version.major_version(); - native_adapter->plugin_version.minor = version.minor_version(); - native_adapter->plugin_version.release = version.release_version(); - - // Initialize adapter methods - native_adapter->adapter_plugin_data = - static_cast(adapter_plugin); - native_adapter->plugin_delete = - AdapterForwarder::delete_plugin; - native_adapter->create_connection = - AdapterForwarder::create_connection; - native_adapter->delete_connection = - AdapterForwarder::delete_connection; - - - return native_adapter; - } - - static void delete_plugin( - void *native_adapter_data, - RTI_RoutingServiceEnvironment *) - { - RTI_RoutingServiceAdapterPluginExt *native_adapter = - static_cast( - native_adapter_data); - AdapterPlugin *adapter = static_cast( - native_adapter->adapter_plugin_data); - // Plug-in is destructor not allowed to throw - delete adapter; - RTIOsapiHeap_freeStructure(native_adapter); - } - - static RTI_RoutingServiceConnectionExt* create_connection( - void *native_adapter_data, - const char *routing_service_name, - const char *routing_service_group_name, - const RTI_RoutingServiceStreamReaderListenerExt *native_output_stream_listener, - const RTI_RoutingServiceStreamReaderListenerExt *native_input_stream_listener, - const RTI_RoutingServiceTypeInfo **registered_types, - int registered_type_count, - const RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - return ConnectionForwarder::create_native( - static_cast(native_adapter_data), - routing_service_name, - routing_service_group_name, - native_output_stream_listener, - native_input_stream_listener, - registered_types, - registered_type_count, - native_properties, - environment); - } - - static void delete_connection( - void *native_adapter_data, - RTI_RoutingServiceConnectionExt *native_connection, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder::delete_native( - static_cast(native_adapter_data), - native_connection, - environment); - } - -}; - - -}}}} - -#endif // RTI_ROUTING_ADAPTER_DETAIL_ADAPTER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ConnectionForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ConnectionForwarder.hpp deleted file mode 100644 index 07fb9be7f..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ConnectionForwarder.hpp +++ /dev/null @@ -1,335 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_CONNECTION_FORWARDER_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_CONNECTION_FORWARDER_HPP_ - -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace rti { namespace routing { namespace adapter { namespace detail { - -class ConnectionForwarder { -public: - static RTI_RoutingServiceConnectionExt * create_native( - AdapterPlugin *adapter, - const char *, - const char *, - const RTI_RoutingServiceStreamReaderListenerExt *native_output_stream_listener, - const RTI_RoutingServiceStreamReaderListenerExt *native_input_stream_listener, - const RTI_RoutingServiceTypeInfo **, - int, - const RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - try { - using rti::routing::detail::ScopedForwarder; - - // Set properties - std::map properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - - ConnectionForwarder *forwarder = new ConnectionForwarder( - native_output_stream_listener, - native_input_stream_listener); - ScopedForwarder scoped( - adapter, - forwarder, - environment); - // Create connection - forwarder->connection_ = adapter->create_connection( - &forwarder->input_discovery_listener_, - &forwarder->output_discovery_listener_, - properties); - RTI_ROUTING_THROW_ON_NULL(forwarder->connection_); - - // Create built-in SRs - forwarder->input_stream_discovery_forwarder_ = - new DiscoveryStreamReaderForwarder( - forwarder->connection_ - ->input_stream_discovery_reader()); - - forwarder->output_stream_discovery_forwarder_ = - new DiscoveryStreamReaderForwarder( - forwarder->connection_ - ->output_stream_discovery_reader()); - - scoped.release(); - - // TRUST-134: the forwarder is not leaked here. It might be leaked - // if delete_native() were not to be called, but Routing Service - // will make sure that is not the case - - /* coverity[leaked_storage : FALSE] */ - return forwarder->native(); - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - return NULL; - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - return NULL; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return NULL; - } - } - - static void delete_native( - AdapterPlugin *adapter, - RTI_RoutingServiceConnectionExt *native_connection, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder *forwarder = static_cast( - native_connection->connection_data); - try { - // delete built-in SRs - delete forwarder->input_stream_discovery_forwarder_; - delete forwarder->output_stream_discovery_forwarder_; - - // delete connection - if (forwarder->connection_ != NULL) { - adapter->delete_connection(forwarder->connection_); - forwarder->connection_ = NULL; - } - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - } - - delete forwarder; - } - - - static RTI_RoutingServiceStreamReaderExt * - get_input_stream_discovery_reader( - void *native_connection_data, - RTI_RoutingServiceEnvironment *) - { - ConnectionForwarder *forwarder = static_cast( - native_connection_data); - return forwarder->input_stream_discovery_forwarder_->native(); - } - - static RTI_RoutingServiceStreamReaderExt * - get_output_stream_discovery_reader( - void *native_connection_data, - RTI_RoutingServiceEnvironment *) - { - ConnectionForwarder *forwarder = static_cast( - native_connection_data); - return forwarder->output_stream_discovery_forwarder_->native(); - } - - static RTI_RoutingServiceSessionExt * create_session( - void *native_connection_data, - const struct RTI_RoutingServiceProperties * native_properties, - RTI_RoutingServiceEnvironment *environment) - { - - ConnectionForwarder *forwarder = static_cast( - native_connection_data); - - return SessionForwarder::create_native( - forwarder->connection_, - native_properties, - environment); - } - - static void delete_session( - void *native_connection_data, - RTI_RoutingServiceSessionExt *native_session, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder *forwarder = static_cast ( - native_connection_data); - - SessionForwarder::delete_native( - forwarder->connection_, - native_session, - environment); - } - - static RTI_RoutingServiceStreamReaderExt* create_stream_reader( - void *native_connection_data, - void *native_session_data, - const struct RTI_RoutingServiceStreamInfo *native_stream_info, - const struct RTI_RoutingServiceProperties *native_properties, - const struct RTI_RoutingServiceStreamReaderListenerExt *native_listener, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder *forwarder = static_cast( - native_connection_data); - SessionForwarder *session_forwarder = static_cast( - native_session_data); - - return StreamReaderForwarder::create_native( - forwarder->connection_, - session_forwarder->session(), - native_stream_info, - native_properties, - native_listener, - environment); - } - - static void delete_stream_reader( - void *native_connection_data, - RTI_RoutingServiceStreamReaderExt *native_reader, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder *forwarder = static_cast( - native_connection_data); - StreamReaderForwarder::delete_native( - forwarder->connection_, - native_reader, - environment); - } - - static RTI_RoutingServiceStreamWriterExt* create_stream_writer( - void *native_connection_data, - void *native_session_data, - const struct RTI_RoutingServiceStreamInfo *native_stream_info, - const struct RTI_RoutingServiceProperties *native_properties, - const struct RTI_RoutingServiceStreamWriterListenerExt *, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder *forwarder = static_cast( - native_connection_data); - SessionForwarder *session_forwarder = static_cast( - native_session_data); - - return StreamWriterForwarder::create_native( - forwarder->connection_, - session_forwarder->session(), - native_stream_info, - native_properties, - environment); - } - - static void delete_stream_writer( - void *native_connection_data, - RTI_RoutingServiceStreamWriterExt *native_writer, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder *forwarder = static_cast( - native_connection_data); - StreamWriterForwarder::delete_native( - forwarder->connection_, - native_writer, - environment); - } - - static void update( - void *native_connection_data, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - ConnectionForwarder *forwarder = - static_cast (native_connection_data); - - rti::routing::detail::UpdatableEntityForwarder::update( - forwarder->connection_, - native_properties, - environment); - } - - - Connection * connection() - { - return connection_; - } - - RTI_RoutingServiceConnectionExt* native() - { - return &this->native_; - } - - RTI_RoutingServiceStreamReaderExt* native_input_discovery_reader() - { - return input_stream_discovery_forwarder_->native(); - } - - RTI_RoutingServiceStreamReaderExt* native_output_discovery_reader() - { - return output_stream_discovery_forwarder_->native(); - } - -private: - - ConnectionForwarder( - const RTI_RoutingServiceStreamReaderListenerExt *native_output_stream_listener, - const RTI_RoutingServiceStreamReaderListenerExt *native_input_stream_listener) : - connection_(NULL), - output_stream_discovery_forwarder_(NULL), - output_discovery_listener_(native_output_stream_listener), - input_stream_discovery_forwarder_(NULL), - input_discovery_listener_(native_input_stream_listener) - { - RTIOsapiMemory_zero(&native_, sizeof(native_)); - - native_.connection_data = static_cast(this); - native_.create_session = ConnectionForwarder::create_session; - native_.delete_session = ConnectionForwarder::delete_session; - native_.create_stream_reader = - ConnectionForwarder::create_stream_reader; - native_.delete_stream_reader = - ConnectionForwarder::delete_stream_reader; - native_.create_stream_writer = - ConnectionForwarder::create_stream_writer; - native_.delete_stream_writer = - ConnectionForwarder::delete_stream_writer; - native_.get_input_stream_discovery_reader = - ConnectionForwarder::get_input_stream_discovery_reader; - native_.get_output_stream_discovery_reader = - ConnectionForwarder::get_output_stream_discovery_reader; - native_.update = ConnectionForwarder::update; - } - - ~ConnectionForwarder() - { - } - -private: - RTI_RoutingServiceConnectionExt native_; - Connection *connection_; - DiscoveryStreamReaderForwarder *output_stream_discovery_forwarder_; - StreamReaderListener output_discovery_listener_; - DiscoveryStreamReaderForwarder *input_stream_discovery_forwarder_; - StreamReaderListener input_discovery_listener_; - -}; - -}}}} - -#endif // RTI_ROUTING_ADAPTER_DETAIL_CONNECTION_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/DiscoveryStreamReaderForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/DiscoveryStreamReaderForwarder.hpp deleted file mode 100644 index e1a934c09..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/DiscoveryStreamReaderForwarder.hpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_DISCOVERY_STREAM_READER_FORWARDER_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_DISCOVERY_STREAM_READER_FORWARDER_HPP_ - -#include - -#include - -#include - -#include -#include - -namespace rti { namespace routing { namespace adapter { namespace detail { - - -class DiscoveryStreamReaderForwarder { -public: - static void take( - void *native_stream_reader_data, - RTI_RoutingServiceSample **sample_array, - RTI_RoutingServiceSampleInfo **sample_info_array, - int *array_length, - RTI_RoutingServiceEnvironment *environment) - { - DiscoveryStreamReaderForwarder *forwarder = - static_cast( - native_stream_reader_data); - - *sample_info_array = NULL; - *array_length = 0; - try { - forwarder->stream_reader_->take(forwarder->sample_seq_); - *array_length = static_cast(forwarder->sample_seq_.size()); - if (*array_length > 0) { - *sample_array = reinterpret_cast ( - &forwarder->sample_seq_[0]); - } - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - } - - static void return_loan( - void *native_stream_reader_data, - RTI_RoutingServiceSample *, - RTI_RoutingServiceSampleInfo *, - int, - RTI_RoutingServiceEnvironment *environment) - { - DiscoveryStreamReaderForwarder *forwarder = - static_cast( - native_stream_reader_data); - - try { - forwarder->stream_reader_->return_loan(forwarder->sample_seq_); - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return; - } - forwarder->sample_seq_.clear(); - } - - - DiscoveryStreamReaderForwarder( - DiscoveryStreamReader *stream_reader) : - stream_reader_(stream_reader) - { - RTIOsapiMemory_zero(&native_, sizeof(native_)); - native_.stream_reader_data = - static_cast(this); - native_.take = - DiscoveryStreamReaderForwarder::take; - native_.return_loan = - DiscoveryStreamReaderForwarder::return_loan; - } - - - ~DiscoveryStreamReaderForwarder() - { - } - - - static DiscoveryStreamReaderForwarder* from_native( - RTI_RoutingServiceStreamReaderExt *native) - { - return static_cast( - native->stream_reader_data); - } - - RTI_RoutingServiceStreamReaderExt * native() - { - return &native_; - } - -private: - RTI_RoutingServiceStreamReaderExt native_; - DiscoveryStreamReader *stream_reader_; - std::vector sample_seq_; -}; - -}}}} - -#endif // RTI_ROUTING_ADAPTER_DETAIL_DISCOVERY_STREAM_READER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ReadProxy.h b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ReadProxy.h deleted file mode 100644 index 3f60c68ec..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/ReadProxy.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_READ_PROXY_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_READ_PROXY_HPP_ - -#include - -namespace rti { namespace routing { namespace adapter { namespace detail { - - -struct TakeProxy { - - TakeProxy (StreamReader& stream_reader) - : stream_reader_(stream_reader) - { - - } - - void operator() ( - std::vector& sample_seq, - std::vector& info_seq) - { - stream_reader_.take(sample_seq, info_seq); - } - -private: - StreamReader& stream_reader_; -}; - -struct ReadProxy { - - ReadProxy (StreamReader& stream_reader) - : stream_reader_(stream_reader) - { - - } - - void operator() ( - std::vector& sample_seq, - std::vector& info_seq) - { - stream_reader_.read(sample_seq, info_seq); - } - -private: - StreamReader& stream_reader_; -}; - -struct TakeSelectorProxy { - - TakeSelectorProxy( - StreamReader& stream_reader, - const rti::routing::adapter::SelectorState& state) - : stream_reader_(stream_reader), state_(state) - { - - } - - void operator() ( - std::vector& sample_seq, - std::vector& info_seq) - { - stream_reader_.take(sample_seq, info_seq, state_); - } - -private: - StreamReader& stream_reader_; - const rti::routing::adapter::SelectorState& state_; -}; - -struct ReadSelectorProxy { - - ReadSelectorProxy ( - StreamReader& stream_reader, - const rti::routing::adapter::SelectorState& state) - : stream_reader_(stream_reader), state_(state) - { - - } - - void operator() ( - std::vector& sample_seq, - std::vector& info_seq) - { - stream_reader_.read(sample_seq, info_seq, state_); - } - -private: - StreamReader& stream_reader_; - const rti::routing::adapter::SelectorState& state_; -}; - - -} } } } - - -#endif /* RTI_ROUTING_ADAPTER_DETAIL_READ_PROXY_HPP_ */ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/SessionForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/SessionForwarder.hpp deleted file mode 100644 index 76389e004..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/SessionForwarder.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_SESSION_FORWARDER_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_SESSION_FORWARDER_HPP_ - -#include - -#include - -#include -#include -#include - -namespace rti { namespace routing { namespace adapter { namespace detail { - - -class SessionForwarder { -public: - static RTI_RoutingServiceSessionExt* create_native( - Connection *connection, - const RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - - try { - using rti::routing::detail::ScopedForwarder; - - // Set properties - std::map properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - - SessionForwarder *forwarder = new SessionForwarder(); - ScopedForwarder scoped( - connection, - forwarder, - environment); - // Create session: Note we don't check for NULL because a Session - // is not required - forwarder->session_ = connection->create_session(properties); - - scoped.release(); - - // TRUST-134: the forwarder is not leaked here. It might be leaked - // if delete_native() were not to be called, but Routing Service - // will make sure that is not the case - - /* coverity[leaked_storage : FALSE] */ - return forwarder->native(); - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - return NULL; - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - return NULL; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return NULL; - } - } - - static void delete_native( - Connection *connection, - RTI_RoutingServiceSessionExt *native_session, - RTI_RoutingServiceEnvironment *environment) - { - SessionForwarder *forwarder = static_cast( - native_session->session_data); - try { - // delete session - if (forwarder->session_ != NULL) { - connection->delete_session(forwarder->session_); - forwarder->session_ = NULL; - } - - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - } - - delete forwarder; - } - - Session * session() - { - return session_; - } - - RTI_RoutingServiceSessionExt* native() - { - return &this->native_; - } - - static void update( - void *native_session_data, - const struct RTI_RoutingServiceProperties * native_properties, - RTI_RoutingServiceEnvironment * environment) - { - SessionForwarder *forwarder = - static_cast (native_session_data); - - rti::routing::detail::UpdatableEntityForwarder::update( - forwarder->session_, - native_properties, - environment); - } - -private: - SessionForwarder() : session_(NULL) - { - RTIOsapiMemory_zero(&native_, sizeof(native_)); - native_.session_data = - static_cast(this); - native_.update = - SessionForwarder::update; - } - - ~SessionForwarder() - { - } - -private: - RTI_RoutingServiceSessionExt native_; - Session *session_; - -}; - -}}}} - -#endif // RTI_ROUTING_ADAPTER_DETAIL_SESSION_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderForwarder.hpp deleted file mode 100644 index e0e14579b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderForwarder.hpp +++ /dev/null @@ -1,524 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_STREAM_READER_FORWARDER_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_STREAM_READER_FORWARDER_HPP_ - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - - -namespace rti { namespace routing { namespace adapter { namespace detail { - -template struct read_or_take; - - -template<> -struct read_or_take { - - static void read( - rti::routing::adapter::StreamReader& stream_reader, - std::vector& sample_seq, - std::vector& info_seq, - const struct RTI_RoutingServiceSelectorState *) - { - stream_reader.take(sample_seq, info_seq); - } -}; - -template<> -struct read_or_take { - - static void read( - rti::routing::adapter::StreamReader& stream_reader, - std::vector& sample_seq, - std::vector& info_seq, - const struct RTI_RoutingServiceSelectorState *) - { - stream_reader.read(sample_seq, info_seq); - } -}; - -template<> -struct read_or_take { - - static void read( - rti::routing::adapter::StreamReader& stream_reader, - std::vector& sample_seq, - std::vector& info_seq, - const struct RTI_RoutingServiceSelectorState *native_selector) - { - stream_reader.take( - sample_seq, - info_seq, - SelectorState(*native_selector)); - } -}; - - -template<> -struct read_or_take { - - static void read( - rti::routing::adapter::StreamReader& stream_reader, - std::vector& sample_seq, - std::vector& info_seq, - const struct RTI_RoutingServiceSelectorState *native_selector) - { - stream_reader.read( - sample_seq, - info_seq, - SelectorState(*native_selector)); - } -}; - - -struct SamplesHolder { -public: - - SamplesHolder() - { - } - - std::vector sample_seq_; - std::vector info_seq_; -}; - -class StreamReaderForwarder { -public: - static RTI_RoutingServiceStreamReaderExt* create_native( - Connection *connection, - Session *session, - const struct RTI_RoutingServiceStreamInfo *native_stream_info, - const struct RTI_RoutingServiceProperties *native_properties, - const struct RTI_RoutingServiceStreamReaderListenerExt *native_listener, - RTI_RoutingServiceEnvironment *environment) - { - - try { - using rti::routing::detail::ScopedForwarder; - - StreamInfo stream_info(*native_stream_info); - - std::map properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - - StreamReaderForwarder *forwarder = new StreamReaderForwarder( - native_listener); - ScopedForwarder scoped( - connection, - forwarder, - environment); - forwarder->stream_reader_ = connection->create_stream_reader( - session, - stream_info, - properties, - &forwarder->listener_); - RTI_ROUTING_THROW_ON_NULL(forwarder->stream_reader_); - - scoped.release(); - - // TRUST-134: the forwarder is not leaked here. It might be leaked - // if delete_native() were not to be called, but Routing Service - // will make sure that is not the case - - /* coverity[leaked_storage : FALSE] */ - return forwarder->native(); - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - return NULL; - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - return NULL; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return NULL; - } - - - } - - static void delete_native( - Connection *connection, - RTI_RoutingServiceStreamReaderExt *native_stream_reader, - RTI_RoutingServiceEnvironment *environment) - { - StreamReaderForwarder *stream_reader_forwarder = - from_native(native_stream_reader); - try { - if (stream_reader_forwarder->stream_reader_ != NULL) { - connection->delete_stream_reader( - stream_reader_forwarder->stream_reader_); - stream_reader_forwarder->stream_reader_ = NULL; - } - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - delete stream_reader_forwarder; - } - - - RTI_RoutingServiceStreamReaderExt* native() - { - return &this->native_; - } - - -private: - - StreamReaderForwarder( - const RTI_RoutingServiceStreamReaderListenerExt *native_listener) : - stream_reader_(NULL), - listener_(native_listener) - { - RTIOsapiMemory_zero(&native_, sizeof(native_)); - native_.stream_reader_data = - static_cast(this); - native_.take = - StreamReaderForwarder::take; - native_.read = - StreamReaderForwarder::read; - native_.take_w_selector = - StreamReaderForwarder::take_with_selector; - native_.read_w_selector = - StreamReaderForwarder::read_with_selector; - native_.return_loan = - StreamReaderForwarder::return_loan; - native_.create_content_query = - StreamReaderForwarder::create_content_query; - native_.delete_content_query = - StreamReaderForwarder::delete_content_query; - native_.update = - StreamReaderForwarder::update; - } - - ~StreamReaderForwarder() - { - // delete holders - for (std::list::iterator it = holder_pool_.begin(); - it != holder_pool_.end(); - ++it) { - delete (*it); - } - } - - - static void take( - void *native_stream_reader_data, - RTI_RoutingServiceSample **sample_array, - RTI_RoutingServiceSampleInfo **sample_info_array, - int *array_length, - RTI_RoutingServiceEnvironment *environment) - { - proxy_read( - native_stream_reader_data, - sample_array, - sample_info_array, - array_length, - NULL, - environment); - } - - static void read( - void *native_stream_reader_data, - RTI_RoutingServiceSample **sample_array, - RTI_RoutingServiceSampleInfo **sample_info_array, - int *array_length, - RTI_RoutingServiceEnvironment *environment) - { - proxy_read( - native_stream_reader_data, - sample_array, - sample_info_array, - array_length, - NULL, - environment); - } - - static void take_with_selector( - void *native_stream_reader_data, - RTI_RoutingServiceSample **sample_array, - RTI_RoutingServiceSampleInfo **sample_info_array, - int *array_length, - const struct RTI_RoutingServiceSelectorState *native_selector, - RTI_RoutingServiceEnvironment *environment) - { - proxy_read( - native_stream_reader_data, - sample_array, - sample_info_array, - array_length, - native_selector, - environment); - } - - static void read_with_selector( - void *native_stream_reader_data, - RTI_RoutingServiceSample **sample_array, - RTI_RoutingServiceSampleInfo **sample_info_array, - int *array_length, - const struct RTI_RoutingServiceSelectorState *native_selector, - RTI_RoutingServiceEnvironment *environment) - { - proxy_read( - native_stream_reader_data, - sample_array, - sample_info_array, - array_length, - native_selector, - environment); - } - - static void return_loan( - void *native_stream_reader_data, - RTI_RoutingServiceSample *native_samples, - RTI_RoutingServiceSampleInfo *, - int count, - RTI_RoutingServiceEnvironment *environment) - { - StreamReaderForwarder *forwarder = - static_cast(native_stream_reader_data); - assert(forwarder != NULL); - - SamplesHolder *holder = static_cast( - native_samples[count]); - assert(holder != NULL); - - - try { - forwarder->stream_reader_->return_loan( - holder->sample_seq_, - holder->info_seq_); - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - forwarder->return_holder(holder); - } - - static void update( - void *native_stream_reader_data, - const struct RTI_RoutingServiceProperties * native_properties, - RTI_RoutingServiceEnvironment * environment) - { - - StreamReaderForwarder *stream_reader_forwarder = - static_cast(native_stream_reader_data); - - rti::routing::detail::UpdatableEntityForwarder::update( - stream_reader_forwarder->stream_reader_, - native_properties, - environment); - } - - static void* create_content_query( - void *native_stream_reader_data, - RTI_RoutingServiceSelectorStateQueryData old_query_data, - const struct RTI_RoutingServiceSelectorContent *content, - RTI_RoutingServiceEnvironment *environment) - { - StreamReaderForwarder *forwarder = - static_cast(native_stream_reader_data); - - void *query_data = NULL; - try { - dds::topic::Filter filter( - content->expression == NULL ? "" : content->expression, - rti::core::native_conversions::from_native( - content->expression_parameters)); - query_data = forwarder->stream_reader_->create_content_query( - old_query_data, - filter); - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - return query_data; - } - - static void delete_content_query( - void *native_stream_reader_data, - RTI_RoutingServiceSelectorStateQueryData query_data, - RTI_RoutingServiceEnvironment *environment) - { - StreamReaderForwarder *forwarder = - static_cast(native_stream_reader_data); - try { - forwarder->stream_reader_->delete_content_query(query_data); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "%s", - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - } - - static StreamReaderForwarder* from_native( - RTI_RoutingServiceStreamReaderExt *native) - { - return static_cast(native->stream_reader_data); - } - - template - static void proxy_read( - void *native_stream_reader_data, - RTI_RoutingServiceSample **sample_array, - RTI_RoutingServiceSampleInfo **sample_info_array, - int *array_length, - const struct RTI_RoutingServiceSelectorState *native_selector, - RTI_RoutingServiceEnvironment *environment) - { - StreamReaderForwarder *forwarder = - static_cast(native_stream_reader_data); - assert(forwarder != NULL); - - SamplesHolder *holder = forwarder->get_holder(); - - *array_length = 0; - try { - read_or_take::read( - *forwarder->stream_reader_, - holder->sample_seq_, - holder->info_seq_, - native_selector); - if (!holder->info_seq_.empty() - && (holder->info_seq_.size() != holder->sample_seq_.size())) { - throw dds::core::PreconditionNotMetError( - "sample and info sequences length mismatch"); - } - /* - * We reserve a hidden slot in the sample_seq to keep the original - * loaned returned from the native StreamReader. This allows us - * to quickly access it on return_loan(), instead of having to search - * in a list. - * - * TRUST-1466: reserving just 1 more memory spot can be inefficient, - * and we're doing this for every read/take operation called in C++. - */ - if (holder->sample_seq_.size() + 1 - >= holder->sample_seq_.capacity()) { - holder->sample_seq_.reserve( - holder->sample_seq_.capacity() == 0 - ? 1 - : 2 * holder->sample_seq_.capacity()); - } - *(holder->sample_seq_.data() + holder->sample_seq_.size()) = holder; - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - forwarder->return_holder(holder); - return; - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - forwarder->return_holder(holder); - return; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - forwarder->return_holder(holder); - return; - } - - // direct mapping - *array_length = static_cast(holder->sample_seq_.size()); - *sample_array = holder->sample_seq_.data(); - if (holder->info_seq_.empty()) { - *sample_info_array = NULL; - } else { - *sample_info_array = &holder->info_seq_[0]; - } - } - - SamplesHolder* get_holder() - { - if (holder_pool_.size() == 0) { - return new SamplesHolder(); - } - - SamplesHolder *holder = holder_pool_.front(); - holder_pool_.pop_front(); - - return holder; - } - - void return_holder(SamplesHolder *holder) - { - holder->sample_seq_.clear(); - holder->info_seq_.clear(); - holder_pool_.push_front(holder); - } - -private: - - RTI_RoutingServiceStreamReaderExt native_; - StreamReader *stream_reader_; - StreamReaderListener listener_; - std::list holder_pool_; -}; - -}}}} - -#endif // RTI_ROUTING_ADAPTER_DETAIL_STREAM_READER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderListenerForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderListenerForwarder.hpp deleted file mode 100644 index 164e0ad78..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamReaderListenerForwarder.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_STREAM_READER_LISTENER_FORWARDER_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_STREAM_READER_LISTENER_FORWARDER_HPP_ - -#include - -#include - -#include -#include - -namespace rti { namespace routing { namespace adapter { namespace detail { - -/** @ingroup RTI_RoutingServiceAdapterModule - * - * @class rti::routing::adapter::StreamReaderListener - * - * @brief Listener representation used by StreamReader to notify @product - * when new data is available. - * - * When a StreamReader receives new data, it shall call - * StreamReaderListener::on_data_available to wake up the associated Session. - * After that, the Session will invoke any of the StreamReader operations to - * read the new data. - * - */ -class StreamReaderListener { -public: - -public: - /** - * @brief Operation to notify @product about data available on the - * a StreamReader. - * - * @param stream_reader - * @rs_st_in Stream reader for which new data is available. - * - */ - void on_data_available( - rti::routing::adapter::StreamReader *stream_reader) - { - native_listener_.on_data_available( - static_cast(stream_reader), - native_listener_.listener_data); - } - - - StreamReaderListener( - const RTI_RoutingServiceStreamReaderListenerExt *native_listener) : - native_listener_(*native_listener) - { - } - - ~StreamReaderListener() - { - } - -private: - - RTI_RoutingServiceStreamReaderListenerExt native_listener_; - -}; - -}}}} - -#endif // RTI_ROUTING_ADAPTER_DETAIL_STREAM_READER_LISTENER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamWriterForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamWriterForwarder.hpp deleted file mode 100644 index 9105a481e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/adapter/detail/StreamWriterForwarder.hpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ADAPTER_DETAIL_STREAM_WRITER_FORWARDER_HPP_ -#define RTI_ROUTING_ADAPTER_DETAIL_STREAM_WRITER_FORWARDER_HPP_ - -#include - -#include - -#include -#include -#include - -namespace rti { namespace routing { namespace adapter { namespace detail { - - -class StreamWriterForwarder { -public: - - static RTI_RoutingServiceStreamWriterExt* create_native( - Connection *connection, - Session *session, - const struct RTI_RoutingServiceStreamInfo *native_stream_info, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - try { - using rti::routing::detail::ScopedForwarder; - - StreamInfo stream_info(*native_stream_info); - - std::map properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - - StreamWriterForwarder *forwarder = new StreamWriterForwarder( - NULL); - ScopedForwarder scoped( - connection, - forwarder, - environment); - forwarder->stream_writer_ = connection->create_stream_writer( - session, - stream_info, - properties); - RTI_ROUTING_THROW_ON_NULL(forwarder->stream_writer_); - - scoped.release(); - - // TRUST-134: the forwarder is not leaked here. It might be leaked - // if delete_native() were not to be called, but Routing Service - // will make sure that is not the case - - /* coverity[leaked_storage : FALSE] */ - return forwarder->native(); - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - return NULL; - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - return NULL; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return NULL; - } - - } - - static void delete_native( - Connection *connection, - RTI_RoutingServiceStreamWriterExt *native_stream_writer, - RTI_RoutingServiceEnvironment *environment) - { - StreamWriterForwarder *stream_writer_forwarder = - static_cast( - native_stream_writer->stream_writer_data); - try { - if (stream_writer_forwarder->stream_writer_ != NULL) { - connection->delete_stream_writer( - stream_writer_forwarder->stream_writer_); - stream_writer_forwarder->stream_writer_ = NULL; - } - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - } - - delete stream_writer_forwarder; - } - - - static int write( - void *native_stream_writer_data, - const RTI_RoutingServiceSample *sample_array, - const RTI_RoutingServiceSampleInfo *sample_info_array, - int array_length, - RTI_RoutingServiceEnvironment *environment) - { - - StreamWriterForwarder *forwarder = - static_cast(native_stream_writer_data); - - try { - RTI_ROUTING_SAMPLE_VECTOR_COPY_FROM_NATIVE( - forwarder->sample_seq_, - sample_array, - array_length); - if (sample_info_array != NULL) { - RTI_ROUTING_SAMPLE_VECTOR_COPY_FROM_NATIVE( - forwarder->info_seq_, - sample_info_array, - array_length); - } else { - forwarder->info_seq_.clear(); - } - return forwarder->stream_writer_->write( - forwarder->sample_seq_, - forwarder->info_seq_); - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - return 0; - } - - static void update( - void *native_stream_writer_data, - const struct RTI_RoutingServiceProperties * native_properties, - RTI_RoutingServiceEnvironment * environment) - { - - StreamWriterForwarder *stream_writer_forwarder = - static_cast (native_stream_writer_data); - - rti::routing::detail::UpdatableEntityForwarder::update( - stream_writer_forwarder->stream_writer_, - native_properties, - environment); - } - - RTI_RoutingServiceStreamWriterExt* native() - { - return &this->native_; - } - -private: - - StreamWriterForwarder( - StreamWriter *stream_writer) : - stream_writer_(stream_writer) - { - RTIOsapiMemory_zero(&native_, sizeof(native_)); - native_.stream_writer_data = - static_cast(this); - native_.write = - StreamWriterForwarder::write; - native_.update = - StreamWriterForwarder::update; - - } - - ~StreamWriterForwarder() - { - } - -private: - RTI_RoutingServiceStreamWriterExt native_; - StreamWriter *stream_writer_; - std::vector sample_seq_; - std::vector info_seq_; - -}; - -}}}} - -#endif // RTI_ROUTING_ADAPTER_DETAIL_STREAM_WRITER_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ForwarderUtils.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ForwarderUtils.hpp deleted file mode 100644 index a0456b5db..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ForwarderUtils.hpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_DETAIL_FORWARDER_UTILS_UTILS_HPP_ -#define RTI_ROUTING_DETAIL_FORWARDER_UTILS_UTILS_HPP_ - -#include - -#include -#include -#include - -namespace rti { namespace routing { namespace detail { - -#define RTI_ROUTING_THROW_ON_NULL(pointer) \ - if ((pointer) == NULL) { \ - throw dds::core::Error("invalid return of NULL"); \ - } - -#define RTI_ROUTING_THROW_ON_ENV_ERROR(NATIVE_ENV) \ - if (RTI_RoutingServiceEnvironment_error_occurred((NATIVE_ENV))) { \ - dds::core::Error rex( \ - RTI_RoutingServiceEnvironment_get_error_message((NATIVE_ENV))); \ - RTI_RoutingServiceEnvironment_clear_error((NATIVE_ENV)); \ - throw rex; \ - } - -#define RTI_ROUTING_SAMPLE_VECTOR_COPY_FROM_NATIVE( \ - VECTOR, \ - NATIVE_ARRAY, \ - ARRAY_LENGTH) \ - (VECTOR).resize((ARRAY_LENGTH)); \ - memcpy(&((VECTOR)[0]), \ - (NATIVE_ARRAY), \ - sizeof (void*) * (ARRAY_LENGTH)); - -#define RTI_ROUTING_SAMPLE_VECTOR_COPY_FROM_NATIVE_W_OFFSET( \ - VECTOR, \ - NATIVE_ARRAY, \ - OFFSET, \ - ARRAY_LENGTH) \ - (VECTOR).resize((ARRAY_LENGTH) + (OFFSET)); \ - memcpy(&((VECTOR)[OFFSET]), \ - (NATIVE_ARRAY), \ - sizeof (void*) * (ARRAY_LENGTH)); - - -#define RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS( \ - TO_VECTOR, \ - FROM_VECTOR) \ - (TO_VECTOR).resize((FROM_VECTOR).size()); \ - if ((FROM_VECTOR).size() > 0) { \ - memcpy( \ - &(TO_VECTOR[0]), \ - &(FROM_VECTOR)[0], \ - sizeof(void*) * (FROM_VECTOR).size()); \ - } - - -template -struct ScopedForwarder { - - ScopedForwarder( - OwnerType *owner, - ForwarderType *forwarder, - RTI_RoutingServiceEnvironment *environment) - :owner_(owner), forwarder_(forwarder), environment_(environment) - { - } - - void release() - { - forwarder_ = NULL; - } - - ~ScopedForwarder() - { - if (forwarder_ != NULL) { - ForwarderType::delete_native( - owner_, - forwarder_->native(), - environment_); - } - } - -private: - - OwnerType *owner_; - ForwarderType *forwarder_; - RTI_RoutingServiceEnvironment *environment_; - -}; - - -} } } - - -#endif // RTI_ROUTING_DETAIL_FORWARDER_UTILS_UTILS_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/RoutingServiceImpl.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/RoutingServiceImpl.hpp deleted file mode 100644 index 93efb1328..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/RoutingServiceImpl.hpp +++ /dev/null @@ -1,243 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_ROUTING_SERVICE_IMPL_HPP_ -#define RTI_ROUTING_ROUTING_SERVICE_IMPL_HPP_ - -#include -#include -#include "routingservice/routingservice_adapter.h" -#include "routingservice/routingservice_service.h" -#include "routingservice/routingservice_log.h" -#include "routingservice/routingservice_remote_config.h" -#include "routingservice/ServiceAdmin.h" - -#include -#include -#include -#include -#include -#include - -namespace rti { namespace routing { -class RoutingServiceImpl - : public rti::core::detail::RetainableType { -public: - - typedef RTI::Service::Admin::CommandRequest CommandRequest; - typedef RTI::Service::Admin::CommandReply CommandReply; - - template - explicit RoutingServiceImpl( - const ServiceProperty& property, - HookFunc& shutdown_hook) - : native_(RTI_RoutingService_new(&property.native())), - shutdown_hook_fwd_( - new rti::routing::detail::ShutdownHookForwarder( - shutdown_hook)) - { - rti::core::check_create_entity(native_, "RoutingService"); - RTI_RoutingService_set_remote_shutdown_hook( - native_, - shutdown_hook_fwd_->native()); - } - - explicit RoutingServiceImpl(const ServiceProperty& property) - : native_(RTI_RoutingService_new(&property.native())), - shutdown_hook_fwd_(nullptr) - { - rti::core::check_create_entity(native_, "RoutingService"); - } - - RoutingServiceImpl(const RTI_RoutingServiceProperty& property) - : native_(RTI_RoutingService_new(&property)), - shutdown_hook_fwd_(NULL) - { - rti::core::check_create_entity(native_, "RoutingService"); - } - - RoutingServiceImpl(RTI_RoutingService *native) - : native_(native), shutdown_hook_fwd_(NULL) - { - rti::core::check_create_entity(native_, "RoutingService"); - } - - ~RoutingServiceImpl() - { - RTI_RoutingService_delete(native_); - delete shutdown_hook_fwd_; - } - - void start() - { - if (!RTI_RoutingService_start(native_)) { - throw dds::core::Error("failed to start RoutingService"); - } - } - - void stop() - { - if (!RTI_RoutingService_stop(native_)) { - throw dds::core::Error("failed to stop RoutingService"); - } - } - - void attach_adapter_plugin( - rti::routing::adapter::AdapterPlugin *adapter_plugin, - const std::string& registered_name) - { - RTI_RoutingServiceAdapterPluginExt *native_plugin = - adapter::detail::AdapterForwarder::create_plugin(adapter_plugin); - if (!RTI_RoutingService_attach_adapter_plugin( - native_, - native_plugin, - registered_name.c_str())) { - throw dds::core::Error("failed to attach native adapter"); - } - } - - void attach_transformation_plugin( - rti::routing::transf::TransformationPlugin *transformation_plugin, - const std::string& registered_name) - { - RTI_RoutingServiceTransformationPlugin *native_plugin = - transf::detail::TransformationPluginForwarder::create_plugin( - transformation_plugin); - if (!RTI_RoutingService_attach_transformation_plugin( - native_, - native_plugin, - registered_name.c_str())) { - throw dds::core::Error("failed to attach native transformation"); - } - } - - void attach_processor_plugin( - rti::routing::processor::ProcessorPlugin *processor_plugin, - const std::string& registered_name) - { - RTI_RoutingServiceProcessorPlugin *native_plugin = - processor::detail::ProcessorPluginForwarder::create_plugin( - processor_plugin); - if (!RTI_RoutingService_attach_processor_plugin( - native_, - native_plugin, - registered_name.c_str())) { - throw dds::core::Error("failed to attach native processor"); - } - } - - CommandReply& execute_command( - CommandReply& reply, - const CommandRequest& request) - { - RTI_Service_Admin_CommandRequest native_request = - RTI_Service_Admin_CommandRequest_INITIALIZER; - RTI_Service_Admin_CommandReply *native_reply_ptr = nullptr; - - if (!RTI_Service_Admin_CommandRequest_initialize(&native_request)) { - RTI_Service_Admin_CommandRequest_finalize(&native_request); - throw dds::core::Error("failed to initialize CommandRequest"); - } - std::shared_ptr request_ptr( - &native_request, - [](RTI_Service_Admin_CommandRequest *native_req_ptr) { - RTI_Service_Admin_CommandRequest_finalize(native_req_ptr); - }); - - to_native(native_request, request); - RTI_RoutingService_execute_command( - native_, - &native_reply_ptr, - &native_request); - from_native(reply, *native_reply_ptr); - RTI_RoutingService_return_reply(native_, native_reply_ptr); - return reply; - } - - CommandReply execute_command(const CommandRequest& request) - { - CommandReply reply; - return execute_command(reply, request); - } - - - RTI_RoutingService* native() const - { - return native_; - } - -private: - - RTI_RoutingService *native_; - - rti::routing::detail::AbstractShutdownHookForwarder *shutdown_hook_fwd_; - - static RTI_Service_Admin_CommandRequest& to_native( - RTI_Service_Admin_CommandRequest& native, - const RTI::Service::Admin::CommandRequest& request) - { - native.action = static_cast( - request.action()); - if (request.application_name().is_set()) { - if (DDS_String_replace( - &native.application_name, - request.application_name().get().c_str()) == NULL) { - throw dds::core::Error("failed to set application name"); - } - } - native.instance_id = request.instance_id(); - if (DDS_String_replace( - &native.resource_identifier, - request.resource_identifier().c_str()) == NULL) { - throw dds::core::Error("failed to set resource identifier"); - } - if (DDS_String_replace( - &native.string_body, - request.string_body().c_str()) == NULL) { - throw dds::core::Error("failed to set string body"); - } - if (!DDS_OctetSeq_from_array( - &native.octet_body, - (DDS_Octet *) request.octet_body().data(), - (DDS_Long) request.octet_body().size())) { - throw dds::core::Error("failed to set octet body"); - } - return native; - } - - static RTI::Service::Admin::CommandReply& from_native( - RTI::Service::Admin::CommandReply& reply, - const RTI_Service_Admin_CommandReply& native) - { - using namespace RTI::Service::Admin; - - reply.retcode(static_cast(native.retcode)); - reply.native_retcode(native.native_retcode); - DDS_Octet *native_octet_body = DDS_OctetSeq_get_contiguous_buffer( - (DDS_OctetSeq *) &native.octet_body); - if (DDS_OctetSeq_get_length(&native.octet_body) < 0) { - throw dds::core::Error("invalid octet_body length"); - } - reply.octet_body().resize( - (size_t) DDS_OctetSeq_get_length(&native.octet_body)); - std::copy( - native_octet_body, - native_octet_body + DDS_OctetSeq_get_length(&native.octet_body), - reply.octet_body().begin()); - reply.string_body(native.string_body); - - return reply; - } - -}; - -}} - -#endif // RTI_ROUTINGv_ROUTING_SERVICE_IMPL_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ShutdownHookForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ShutdownHookForwarder.hpp deleted file mode 100644 index 876faa90b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/ShutdownHookForwarder.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_SHUTDOWN_HOOK_HPP_ -#define RTI_ROUTING_SHUTDOWN_HOOK_HPP_ - - -#include "routingservice/routingservice_service.h" - -namespace rti { namespace routing { namespace detail { - -class AbstractShutdownHookForwarder { -public: - - AbstractShutdownHookForwarder() - { - native_.on_shutdown = on_shutdown_forwarder; - native_.shutdown_hook_data = this; - } - - virtual ~AbstractShutdownHookForwarder() - { - } - - virtual void on_shutdown() - { - } - - static void on_shutdown_forwarder(void *hook_data) - { - AbstractShutdownHookForwarder *self = - static_cast(hook_data); - try { - self->on_shutdown(); - } catch(...) {} - } - - - const RTI_RoutingServiceRemoteShutdownHook* native() const - { - return &native_; - } - -private: - RTI_RoutingServiceRemoteShutdownHook native_; -}; - -template -class ShutdownHookForwarder : public AbstractShutdownHookForwarder { -public: - ShutdownHookForwarder(HookFunc& shutdown_hook) - : shutdown_hook_(shutdown_hook) - { - - } - - void on_shutdown() - { - shutdown_hook_(); - }; - -private: - HookFunc& shutdown_hook_; -}; - -} - -} } - - -#endif /* RTI_ROUTING_SHUTDOWN_HOOK_HPP_ */ - diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/UpdatableEntityForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/UpdatableEntityForwarder.hpp deleted file mode 100644 index b142e92a5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/detail/UpdatableEntityForwarder.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_DETAIL_UPDATABLE_ENTITY_FORWARDER_HPP_ -#define RTI_ROUTING_DETAIL_UPDATABLE_ENTITY_FORWARDER_HPP_ - -#include - -#include - -#include -#include -#include - -namespace rti { namespace routing { namespace detail { - - -class UpdatableEntityForwarder { -public: - - static void update( - UpdatableEntity *updatable_entity, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - - try { - // Set properties - PropertySet properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - updatable_entity->update(properties); - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return; - } - } - -}; - -}}} - -#endif // RTI_ROUTING_DETAIL_UPDATABLE_ENTITY_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/log/LogConfig.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/log/LogConfig.hpp deleted file mode 100644 index b0dab030e..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/log/LogConfig.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - (c) Copyright, Real-Time Innovations, 2017- - All rights reserved. - - No duplications, whole or partial, manual or electronic, may be made without - express written permission. Any such copies, or revisions thereof, must - display this notice unaltered. - - This code contains trade secrets of Real-Time Innovations, Inc. -*/ - -#ifndef HPP_ROUTING_LOG_LOG_CONFIG_HPP_ -#define HPP_ROUTING_LOG_LOG_CONFIG_HPP_ - -#include -#include - -#include "log/log_common.h" -#include "routingservice/routingservice_log.h" - -#include "ndds/ndds_config_c.h" - - -namespace rti { namespace routing { namespace log { - -class LogConfig { -public: - static rti::routing::log::LogConfig& instance() - { - static rti::routing::log::LogConfig singleton; - return singleton; - } - - // Deleted constructor to avoid multiple instances. - LogConfig(const LogConfig&) = delete; - LogConfig(LogConfig&&) = delete; - - RTILogBitmap instrumentation_mask() const - { - NDDS_Config_LogVerbosity verbosity = - NDDS_Config_Logger_get_verbosity_by_service( - NDDS_Config_Logger_get_instance(), - NDDS_CONFIG_LOG_SERVICE_ROUTING); - return (RTILogBitmap) verbosity; - } - - LogConfig& instrumentation_mask(RTILogBitmap logmask) - { - NDDS_Config_Logger_set_verbosity_by_service( - NDDS_Config_Logger_get_instance(), - NDDS_CONFIG_LOG_SERVICE_ROUTING, - (NDDS_Config_LogVerbosity) logmask); - return *this; - } - - void router_instrumentation_mask(RTILogBitmap logmask) - { - instrumentation_mask(logmask); - } - - void update_native(RTILogBitmap logmask) - { - router_instrumentation_mask(logmask); - } - -private: - // Constructor is private: this class is a singleton - LogConfig() = default; -}; - -}}} // rti::routing::log - -#endif /* HPP_ROUTING_LOG_LOG_CONFIG_HPP_ */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Input.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Input.hpp deleted file mode 100644 index 89cef2f41..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Input.hpp +++ /dev/null @@ -1,703 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_INPUT_HPP_ -#define RTI_ROUTING_PROCESSOR_INPUT_HPP_ - -#include -#include -#include -#include -#include -#include - -#include "routingservice/routingservice_processor.h" -#include "routingservice/routingservice_adapter_new.h" -#include -#include -#include -#include - -namespace rti { namespace routing { namespace processor { - -class Route; - -template class TypedInput; - -template -class TypedInput; - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::Input - * - * @brief Generic Representation of a Route's input. - * - * - * This class provides a base representation of the inputs contained in a Route. - * Since it is generic, this object does not allow you to perform any operation - * that requires dealing with the data provided by the underlying - * rti::routing::adapter::StreamReader. - */ -class Input { -public: - - /*i - */ - Input(RTI_RoutingServiceInput *native, - int32_t index, - RTI_RoutingServiceRoute *native_route) - : native_(native), - index_(index), - native_route_(native_route), - stream_info_("", ""), - name_(RTI_RoutingServiceInput_get_name(native)) - { - const RTI_RoutingServiceStreamInfo *native_stream_info = - RTI_RoutingServiceInput_get_stream_info(native); - if (native_stream_info == nullptr) { - throw dds::core::InvalidArgumentError( - "invalid argument: invalid StreamInfo for input"); - } - stream_info_ = *native_stream_info; - } - - /*i - * - */ - const rti::routing::StreamInfo& stream_info() const - { - return stream_info_; - } - - /*i - * - */ - const std::string& name() const - { - return name_; - } - - /*i - * - */ - int32_t index() - { - return index_; - } - - /** - * @brief Returns a typed version of this Input. - * - * Note: This operation is not type-safe. It is the caller's responsibility - * to use the appropriate type. - * - * - * @see TypedInput - * @see TypedInput Route::input(int32_t index) - */ - template - TypedInput get() - { - return this; - } - - /** - * @brief Returns a typed version of this Input. - * - * Note: This operation is not type-safe. It is the caller's responsibility - * to use the appropriate type. - * - * @see TypedInput - * @see TypedInput Route::input(int32_t index) - */ - template - TypedInput get() - { - return this; - } - - /*i - * - */ - RTI_RoutingServiceInput* native() - { - return native_; - } - - // Implementation details -private: - - template friend class TypedInput; - friend class Route; - friend class std::allocator; - RTI_RoutingServiceInput *native_; - int32_t index_; - RTI_RoutingServiceRoute *native_route_; - rti::routing::StreamInfo stream_info_; - std::string name_; -}; - -template -class Selector; - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::TypedInput - * - * @brief Representation of an Input whose data representation is \p DataRep, - * whose info representation is \p InfoRep. - * - */ -template -class TypedInput{ -public: - - typedef rti::routing::processor::Selector Selector; - - TypedInput(Input *input); - - /** - * @brief Returns the StreamInfo associated with this object. - * - * The associated StreamInfo represents an equivalent object to the one - * used to create the underlying rti::routing::adapter::StreamReader. - */ - const rti::routing::StreamInfo& stream_info() const; - - /** - * @brief Returns the name of this output. - * - * The name is given by the name of the corresponding XML configuration tag. - */ - const std::string& name() const; - - /** - * @brief Returns all the available samples in this object. - * - * This operation will call rti::routing::adapter::StreamReader::take on - * the underlying rti::routing::adapter::StreamReader. - * - * The returned samples are interpreted to contain data represented - * as \c Data and info represented as \c Info. - * - * @see LoanedSamples - * @see rti::routing::adapter::StreamReader::take - */ - LoanedSamples take(); - - /** - * @brief Same as take() but this calls - * rti::routing::adapter::StreamReader::read instead. - * - * @see LoanedSamples - * @see rti::routing::adapter::StreamReader::read - * @see take - */ - LoanedSamples read(); - - /** - * @brief Gets a Selector to perform complex data selections, such as - * per-instance selection, content and status filtering. - * - * The selector can be used as follows: - * \code{.c++} - * LoanedSamples samples = input.select() - * .instance(handle) - * .content(query) - * .state(state) - * .take(); - * \endcode - * - * This shows how samples can be taken by selecting a specific instance, - * then filtering by state and content. - * - * Note that when the application wants to access all available samples, - * it can simply call read() or take(). - * - * @return A Selector, typically used in-line to configure it and finally - * call Selector::read() or Selector::take(). - * - * @see Selector for the different parameters that can be set to - * configure which samples to read or take. Selecting what samples to - * read. - */ - Selector select(); - - rti::routing::processor::Query query( - const dds::topic::Filter& filter); - - /** - * @brief Indicates whether this input has received new data since the last - * time any variant of the read operations was called. - * - * @note Given the time decoupling between the notification of new data and - * when it the data is read, it is possible this function may return - * true and yet there is no data to be returned. - * - * @return True if this input has new data received since the last read - * access. - */ - bool active(); - - /** - * @brief Creates a new data sample from this input. - * - * The data constructor called in this operation depends on the data - * representation kind of the TypeInfo associated with this input. - * If the type representation is a dynamic type, then it will assume - * the following constructor: - * \code Data(const dds::core::xtypes::DynamicType&) \endcode - * - * and will use the type code object downcasted from the value - * returned by TypeInfo::type_representation. - * - * Otherwise: - * \code Data() \endcode - * - * @return A new data sample - */ - Data create_data(); - - /*i - * - */ - TypedInput* operator->() - { - return this; - } - - - /** - * @brief Returns the underlying DDS DataReader that is part of this - * StreamReader implementation, assuming this input holds a DDS StreamReader. - * - * This operation will throw an exception if this input does not hold a - * DDS StreamReader. - * - * @note The access to the underlying DataReader is allowed only as long as - * this Input remains enabled. The object representing the DataReader - * must be invalidated before the input is disabled, otherwise the behavior - * is undefined. - * - * @throw std::exception - * - * @return dds::sub::DataReader - */ - dds::sub::DataReader dds_data_reader() - { - using rti::core::detail::create_from_native_entity; - - DDS_DataReader *native_reader = - RTI_RoutingServiceInput_get_dds_reader(input_->native_); - if (native_reader == NULL) { - throw dds::core::InvalidArgumentError( - "invalid argument: input does not hold a DDS StreamReader"); - } - - typedef dds::sub::DataReader data_reader_type; - return rti::core::detail::create_from_native_entity( - native_reader); - } - -private: - TypedInput(); - - friend class rti::routing::processor::Selector; - - LoanedSamples take( - const rti::routing::adapter::SelectorState& selector_state); - - LoanedSamples read( - const rti::routing::adapter::SelectorState& selector_state); - - friend class rti::routing::processor::Route; - Input *input_; -}; - - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::Selector - * - * @brief An element that allows reading data that meet a set of specified - * attributes. - * - * The Selector class is used by the TypedInput to compose read and take - * operations. - * - * A Selector has an associated TypedInput and configures the behavior of the - * read or take operation performed by that TypedInput. - * - * For example, to perform a read of at most 5 unread samples: - * \code - * LoanedSamples samples = reader.select() - * .read() - * .max_samples(5) - * .state(dds::sub::status::DataState::new_data()); - * \endcode - * - * @note It's very important to consider that the behavior of this class is - * tightly coupled and dependent on the underlying - * rti::routing::adapter::StreamReader of the attached TypedInput. In - * particular, the samples returned by a Selector depend on the behavior - * of the rti::routing::adapter::StreamReader::take(SelectorState) and - * rti::routing::adapter::StreamReader::read(SelectorState). If the - * implementation of these operations behave according to the requirements, - * then the behavior offered by this class will be consistent. - * - * @see rti::routing::adapter::SelectorState - * @see dds::sub::DataReader::Selector for equivalent semantics and behavior - * with DataReaders - */ -template -class Selector { -public: - - /** - * @brief Create a Selector for a TypedInput. - * - * Selectors are created with the default filter state of the TypedInput. - * - * @param[in] input - * The TypedInput that this Selector is attached to. - */ - Selector(const rti::routing::processor::TypedInput input) - : typed_input_(input), query_(dds::core::null) - { - - } - - /** - * @brief Copy constructor - */ - Selector(const Selector& other) - : typed_input_(other.typed_input_), - state_(other.state_), - query_(other.query_) - { - - } - - /** - * @brief Select a specific dds::sub::status::DataState. - * - * By setting the DataState, you can specify the state of the samples that - * should be read or taken. The DataState of a sample encapsulates the - * SampleState, ViewState, and InstanceState of a sample. - * - * @param[in] the_state - * The selected DataState - * - */ - Selector& state( - const dds::sub::status::DataState& the_state) - { - state_.state(the_state); - return *this; - } - - /** - * @brief Choose to only read/take up to a maximum number of samples. - * - * @param[in] count - * The maximum number of samples to read/take. - */ - Selector& max_samples( - const int32_t count) - { - state_.max_samples(count); - return *this; - } - - /** - * @brief Select a specific instance to read/take. - * - * This operation causes the subsequent read or take operation to access - * only samples belonging the single specified instance whose handle is - * \p the_handle. - * - * Upon successful completion, the data collection will contain samples all - * belonging to the same instance. - * - * The subsequent read/take may operation may fail if the InstanceHandle - * does not correspond to an existing data-object known to the TypedInput. - * - * @param[in] the_handle - * The handle of the instance to select - * - * @see rti::routing::adapter::SelectorState - * @see dds::sub::DataReader::Selector::instance - */ - Selector& instance( - const dds::core::InstanceHandle& the_handle) - { - state_.instance(the_handle); - return *this; - } - - /** - * @brief Select the instance after a specific instance. - * - * This operation causes the subsequent read or take operation to - * access only samples belonging a single instance whose handle is - * considered 'next' after the provided InstanceHandle, \p the_handle. - * - * The accessed samples will all belong to the 'next' instance with - * InstanceHandle 'greater' than the specified previous handle that has - * available samples. - * - * The special value dds::core::InstanceHandle::nil() is guaranteed to be - * 'less than' any valid instance_handle. So the use of the parameter value - * previous_handle == dds::core::InstanceHandle::nil() will return the - * samples for the instance that has the smallest instance_handle among all - * the instances that contain available samples. - * - * Note that it is possible to call the - * dds::sub::next_instance(const dds::core::InstanceHandle& h) operation - * with a previous_handle that does not correspond to an instance currently - * managed by the underlying rti::routing::adapter::StreamReader. - * - * @param[in] the_handle - * The reference instance. The instance after this one will be - * selected. - * - * @see rti::routing::adapter::SelectorState - * @see dds::sub::DataReader::Selector::next_instance - */ - Selector& next_instance( - const dds::core::InstanceHandle& the_handle) - { - state_.next_instance(the_handle); - return *this; - } - - /** - * @brief Select samples based on a content filter parameters. - * - * The effect of using this manipulator is that the subsequent read/take - * will filter the samples based on the dds::topic::Filter. If the - * Input has no samples that meet the constraints, the read/take will not - * return any data. - * - * This selection is applied in combination with the other settings of - * this Selector. - * - * @param[in] the_filter - */ - Selector& filter( - const dds::topic::Filter& the_filter) - { - state_.filter(the_filter); - return *this; - } - - - /** - * @brief Select samples based on a rti::routing::processor::Query. - * - * When passing a Query, the effect of calling this method is that the - * underlying rti::routing::adapter::StreamReader shall filter the samples - * based only on the Query's settings. - * - * Using this manipulator will always override the selection specified - * with Selector::filter, no matter the order in which operations are - * called. To reset this selection, you can call this operation passing - * dds::core::null. - * - * @param[in] the_query - * The Query to read/take with. - */ - Selector& query(const rti::routing::processor::Query& the_query) - { - query_ = the_query; - state_.content(the_query.delegate().get()->query_data_); - return *this; - } - - /** - * @brief Take samples based on the state associated with this Selector. - * - * @note This operation will call rti::routing::adapter::StreamReader::take(SelectorState) - * on the underlying rti::routing::adapter::StreamReader. - * - * @throw std::exception - * - * @return rti::routing::processor::LoanedSamples - */ - LoanedSamples take() - { - return typed_input_.take(state_); - } - - /** - * @brief Read samples based on the state associated with this Selector. - * - * @note This operation will call rti::routing::adapter::StreamReader::read(SelectorState) - * on the underlying rti::routing::adapter::StreamReader. - * - * @throw std::exception - * - * @return rti::routing::processor::LoanedSamples - */ - LoanedSamples read() - { - return typed_input_.read(state_); - } - -private: - rti::routing::processor::TypedInput typed_input_; - rti::routing::adapter::SelectorState state_; - rti::routing::processor::Query query_; -}; - - -template -struct create_data_from_input { - - static Data get(TypedInput& ) - { - return Data(); - } -}; - -template -struct create_data_from_input { - - static dds::core::xtypes::DynamicData get( - TypedInput& input) - { - if (input->stream_info().type_info().type_representation_kind() - != TypeRepresentationKind::DYNAMIC_TYPE) { - throw dds::core::PreconditionNotMetError( - "inconsistent data representation kind"); - } - dds::core::xtypes::DynamicType *type_code = - static_cast ( - input->stream_info().type_info().type_representation()); - return dds::core::xtypes::DynamicData(*type_code); - } -}; - -template -TypedInput::TypedInput(Input *input) -: input_(input) -{ -} - -template -const rti::routing::StreamInfo& TypedInput::stream_info() const -{ - return input_->stream_info_; -} - -template -const std::string& TypedInput::name() const -{ - return input_->name_; -} - -template -LoanedSamples TypedInput::take() -{ - RTI_RoutingServiceLoanedSamples native_samples = - RTI_RoutingServiceLoanedSamples_INITIALIZER; - if (!RTI_RoutingServiceInput_take( - input_->native_, - &native_samples)) { - throw dds::core::Error("error taking samples from native input"); - } - return LoanedSamples(input_->native_, native_samples); -} - -template -LoanedSamples TypedInput::read() -{ - RTI_RoutingServiceLoanedSamples native_samples = - RTI_RoutingServiceLoanedSamples_INITIALIZER; - if (!RTI_RoutingServiceInput_read( - input_->native_, - &native_samples)) { - throw dds::core::Error("error reading samples from native input"); - } - return LoanedSamples(input_->native_, native_samples); -} - -template -rti::routing::processor::Selector -TypedInput::select() -{ - return rti::routing::processor::Selector(*this); -} - -template -rti::routing::processor::Query TypedInput::query( - const dds::topic::Filter& filter) -{ - return rti::routing::processor::Query(input_->native_, filter); - -} - -template -LoanedSamples TypedInput::take( - const rti::routing::adapter::SelectorState& selector_state) -{ - RTI_RoutingServiceLoanedSamples native_samples = - RTI_RoutingServiceLoanedSamples_INITIALIZER; - if (!RTI_RoutingServiceInput_take_w_selector( - input_->native_, - &native_samples, - &selector_state.native())) { - throw dds::core::Error("error taking samples with selector from native input"); - } - return LoanedSamples(input_->native_, native_samples); -} - -template -LoanedSamples TypedInput::read( - const rti::routing::adapter::SelectorState& selector_state) -{ - RTI_RoutingServiceLoanedSamples native_samples = - RTI_RoutingServiceLoanedSamples_INITIALIZER; - if (!RTI_RoutingServiceInput_read_w_selector( - input_->native_, - &native_samples, - &selector_state.native())) { - throw dds::core::Error("error reading samples with selector from native input"); - } - return LoanedSamples(input_->native_, native_samples); -} - -template -bool TypedInput::active() -{ - return RTI_RoutingServiceInput_is_active(input_->native_) ? true : false; -} - -template -Data TypedInput::create_data() -{ - return create_data_from_input::get(*this); -} - -/** - * @brief Convenient definition of a TypedInput whose data representation - * is DynamicData and info representation is dds::sub::SampleInfo. - * - * These data and info representations are expected be used by most of the - * rti::routing::adapter::StreamReader implementations. - */ -typedef TypedInput DynamicDataInput; -typedef dds::sub::DataReader DynamicDataReader; - -} } } - - -#endif // RTI_ROUTING_PROCESSOR_INPUT_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSample.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSample.hpp deleted file mode 100644 index 804329572..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSample.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/* $Id$ - -(c) Copyright, Real-Time Innovations, 2015-2016. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. - - -============================================================================= */ - -#ifndef RTI_ROUTING_PROCESSOR_LOANED_SAMPLE_HPP_ -#define RTI_ROUTING_PROCESSOR_LOANED_SAMPLE_HPP_ - -#include - -namespace rti { namespace routing { namespace processor { - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::LoanedSample - * - * @brief - */ -template -class LoanedSample -{ -public: - /** - * @brief The data type - */ - typedef T DataType; - /** - * @brief The info type - */ - typedef U InfoType; - - LoanedSample() - : _data_ptr(NULL), - _info_ptr(NULL) - {} - - LoanedSample(const DataType * the_data, const InfoType * the_info) - : _data_ptr(the_data), - _info_ptr(the_info) - {} - - - LoanedSample(const void * the_data, const void * the_info) - : _data_ptr(static_cast(the_data)), - _info_ptr(static_cast(the_info)) - {} - - - const DataType & data() const - { - if (_info_ptr != NULL && !info().valid()) { - throw dds::core::PreconditionNotMetError("Invalid data"); - } - - return *_data_ptr; - } - - /** - * @brief Gets the sample info - */ - const InfoType & info() const { - if (_info_ptr == NULL) { - throw dds::core::PreconditionNotMetError( - "Sample Info not available"); - } - - return *_info_ptr; - } - - - operator const DataType & () const - { - return data(); - } - - LoanedSample * operator ->() { - return this; - } - - const LoanedSample * operator ->() const { - return this; - } - - /** - * @brief Compares the data and info - */ - bool operator==(const LoanedSample& other) const - { - if (info() != other.info()) { - return false; - } - - if (info().valid()) { - if (data() != other.data()) { - return false; - } - } - - return true; - } - - bool operator!=(const LoanedSample& other) const - { - return !(*this == other); - } - - void swap(LoanedSample & other) throw() - { - using std::swap; - - swap(_data_ptr, other._data_ptr); - swap(_info_ptr, other._info_ptr); - } - -private: - const DataType * _data_ptr; - const InfoType * _info_ptr; -}; - -} } } - -#endif // RTI_ROUTING_PROCESSOR_LOANED_SAMPLE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSamples.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSamples.hpp deleted file mode 100644 index 4d2a13ef8..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/LoanedSamples.hpp +++ /dev/null @@ -1,306 +0,0 @@ -/* $Id$ - -(c) Copyright, Real-Time Innovations, 2013-2016. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. - - -============================================================================= */ - -#ifndef RTI_ROUTING_PROCESSOR_LOANED_SAMPLES_HPP_ -#define RTI_ROUTING_PROCESSOR_LOANED_SAMPLES_HPP_ - -#include // std::move -#include - -#include "routingservice/routingservice_adapter_new.h" -#include -#include -#include -#include - -namespace rti { namespace routing { namespace processor { - -template class TypedInput; - - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::LoanedSamples - * - * @brief Provides temporary access to a collection of samples (data and info) - * from a TypedInput. - * - * @tparam T The sample data type representation. It has to match the type of - * the underlying rti::routing::adapter::StreamReader of the TypedInput. - * - * @tparam U The sample info type representation. It has to match the type of - * the underlying rti::routing::adapter::StreamReader of the TypedInput. - * - * This STL-like container encapsulates a collection of loaned, read-only data - * samples rti::sub::LoanedSample::data() and - * rti::sub::LoanedSample::info() from a TypedInput. - * - * To obtain a LoanedSamples, you need to call one of the read/take operations - * from a TypedInput. The samples have to be eventually returned to the - * TypedInput by calling rti::routing::adapter::StreamReader::return_loan on - * the underlying rti::routing::adapter::StreamReader of the TypedInput. The - * destructor takes care of that, and the return_loan() function lets you do - * it explicitly if needed. - * - * As a move-only type, copying a LoanedSamples is not allowed. If you need - * to return a LoanedSamples from a function or assign it to another variable, - * use \p dds::core::move() (or \p std::move() for C++11). - * - * Iterators and overloaded subscript operators let you access the samples - * in this container, which are of the type rti::routing::processor::LoanedSample. - * - * This code demonstrates how to access the info and data of each sample in - * a DataReader: - * - * \code - * auto samples = reader.take(); - * for (const auto& sample : samples) { - * if (sample.info().valid()) { - * std::cout << sample.data() << std::endl; - * } - * } - * \endcode - * - * @see dds::sub::LoanedSamples - * - */ -template -class LoanedSamples { -public: - - typedef rti::routing::adapter::StreamReader StreamReader; - typedef typename std::vector SampleSeqType; - typedef typename std::vector InfoSeqType; - - /** - * @brief The iterator type - */ - typedef SampleIterator iterator; - typedef SampleIterator const_iterator; - typedef typename SampleIterator::value_type value_type; - typedef std::ptrdiff_t difference_type; - - /** - * @brief Creates an empty LoanedSamples object. - */ - LoanedSamples() : input_(NULL) - { - native_samples_.data_array = NULL; - native_samples_.info_array = NULL; - native_samples_.length = 0; - - } - -public: - // Private c-tor only to be used by static method create_from_loans() - LoanedSamples( - RTI_RoutingServiceInput *native_input, - RTI_RoutingServiceLoanedSamples& native_samples) - : input_(native_input), - native_samples_(native_samples) - { - } - -public: - - /** - * @brief Automatically returns the loan to the TypedInput used - * to obtained these samples. - * - * @see return_loan - */ - ~LoanedSamples() throw() - { - try { - return_loan(); - } catch (const std::exception&) { // Do not throw in destructor - - } - } - - - /** - * @brief Provides access to the underlying LoanedSample object in - * array-like syntax. - * - * @param[in] index - * The index of the Sample. Allowed values are from 0 to length()-1. - * - * @return A LoanedSample object that refers to data and info - * at the specified \p index. - */ - LoanedSample operator [] (size_t index) - { - return native_samples_.info_array == NULL - ? LoanedSample(native_samples_.data_array[index], NULL) - : LoanedSample( - native_samples_.data_array[index], - native_samples_.info_array[index]); - } - - /** - * @brief Gets the number of samples in this collection - */ - int32_t length() const - { - return native_samples_.length; - } - - /** - * @brief Returns the samples to the TypedInput used to get these - * samples. - * - * Thes operation returns the samples by calling the - * \link rti::routing::adapter::StreamReader::return_loan return_loan\endlink - * operation on the underlying rti::routing::stream::StreamReader of the - * TypedInput. - * - * @note Explicitly calling return_loan is optional, since the - * destructor does it implicitly. - * - * This operation tells the TypedInput that the application - * is done accessing the collection of samples. - * - * It is not necessary for an application to return the loans immediately - * after the call to read or take. However, as these buffers correspond to - * internal resources, the application should not retain them indefinitely. - * - * @throw std::exception - * If there was an error returning the loan to the TypedInput. - */ - void return_loan() - { - if (input_) { - if (!RTI_RoutingServiceInput_return_loan( - input_, - &native_samples_)) { - throw dds::core::Error("error returning loaned samples to native input"); - } - input_ = NULL; // Indicate that this object doesn't hold a loan anymore - } - } - - - /** - * @brief Returns whether the Info part is available for each Data item of - * this set of loaned samples. - */ - bool has_infos() - { - return (native_samples_.info_array != NULL); - } - - - /** - * @brief Gets an iterator to the first sample - */ - iterator begin() - { - return iterator( - native_samples_.data_array, - native_samples_.info_array, - native_samples_.length); - } - - /** - * @brief Gets an iterator to one past the last sample - */ - iterator end() - { - return iterator( - native_samples_.data_array, - native_samples_.info_array, - native_samples_.length, - native_samples_.length); - } - - /** - * @brief Gets an iterator to the first sample - */ - const_iterator begin() const - { - return const_iterator( - native_samples_.data_array, - native_samples_.info_array, - native_samples_.length); - } - - /** - * @brief Gets an iterator to one past the last sample - */ - const_iterator end() const - { - return const_iterator( - native_samples_.data_array, - native_samples_.info_array, - native_samples_.length, - native_samples_.length); - } - - /** - * @brief Swaps two LoanedSamples containers - */ - void swap(LoanedSamples& other) throw() - { - std::swap(input_, other.input_); - std::swap(native_samples_, other.native_samples_); - } - - LoanedSamples(LoanedSamples&& other) - :input_(NULL) - { - native_samples_.data_array = NULL; - native_samples_.info_array = NULL; - native_samples_.length = 0; - other.swap(*this); - } - - - LoanedSamples& operator= (LoanedSamples&& other) throw () - { - // clean up existing values - LoanedSamples temp(std::move(other)); - temp.swap(*this); - return *this; - } - -private: - friend class TypedInput; - - void release() - { - input_ = NULL; - } - - RTI_RoutingServiceLoanedSamples& native_samples() - { - return native_samples_; - } - -private: - // reference to the reader that created this LoanedSamples object - RTI_RoutingServiceInput *input_; - RTI_RoutingServiceLoanedSamples native_samples_; - -}; - -template -LoanedSamples move(LoanedSamples & ls) OMG_NOEXCEPT -{ - return std::move(ls); -} - - -} } } - -#endif // RTI_ROUTING_PROCESSOR_LOANED_SAMPLES_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Output.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Output.hpp deleted file mode 100644 index 3c2636f5a..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Output.hpp +++ /dev/null @@ -1,326 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_OUTPUT_HPP_ -#define RTI_ROUTING_PROCESSOR_OUTPUT_HPP_ - -#include -#include -#include -#include -#include - -#include "routingservice/routingservice_processor.h" -#include "routingservice/routingservice_adapter_new.h" -#include - -namespace rti { namespace routing { namespace processor { - -class Route; - -template class TypedOutput; - -template -class TypedOutput; - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::Output - * - * @brief Generic Representation of a Route's output. - * - * This class provides a base representation of the outputs contained in a Route. - * Since it is generic, this object does not allow performing any operation - * that requires dealing with the data passed to the underlying - * rti::routing::adapter::StreamWriter. - */ -class Output { -public: - - /*i - */ - Output( - RTI_RoutingServiceOutput *native, - int32_t index, - RTI_RoutingServiceRoute *native_route) : - native_(native), - index_(index), - native_route_(native_route), - stream_info_(*RTI_RoutingServiceOutput_get_stream_info(native)), - name_(RTI_RoutingServiceOutput_get_name(native)) - { - } - - /*i - */ - const rti::routing::StreamInfo& stream_info() const - { - return stream_info_; - } - - /*i - * - */ - const std::string& name() const - { - return name_; - } - - /*i - * - */ - int32_t index() - { - return index_; - } - - /** - * @brief Returns a typed version of this Output. - * - * Note: This operation is not type-safe and it is the caller's - * responsibility to use the appropriate type. - * - * @see TypedOutput - * @see TypedOutput Route::output(int32_t index) - */ - template - TypedOutput get() - { - return this; - } - - /** - * @brief Returns a typed version of this Output. - * - * Note: This operation is not type-safe and it is the caller's - * responsibility to use the appropriate type. - * - * @see TypedOutput - * @see TypedOutput Route::output(int32_t index) - */ - template - TypedOutput get() - { - return this; - } - -private: - template friend class TypedOutput; - friend class Route; - RTI_RoutingServiceOutput *native_; - int32_t index_; - RTI_RoutingServiceRoute *native_route_; - rti::routing::StreamInfo stream_info_; - std::string name_; -}; - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::TypedOutput - * - * @brief Representation of an Output whose data representation is \p DataRep, - * whose info representation is \p InfoRep. - * - */ -template -class TypedOutput{ -public: - TypedOutput(Output *output) ; - - TypedOutput* operator->(); - - /** - * @brief Returns the StreamInfo associated with this object. - * - * The associated StreamInfo represents an equivalent object to the one - * used to create the underlying rti::routing::adapter::StreamWriter. - */ - const rti::routing::StreamInfo& stream_info() const; - - /** - * @brief Returns the name of this output. - * - * The name is given by the name of the corresponding XML configuration tag. - */ - const std::string& name() const; - - /** - * @brief Writes the specified data and info sample in this output. - * - * This operation will call rti::routing::adapter::StreamWriter::write on - * the underlying rti::routing::adapter::StreamWriter. - * - * The provided sample is interpreted to contain data represented - * as \c Data and the info as \c Info. - * - * @see rti::routing::adapter::StreamWriter::write - */ - void write(const Data& sample, const Info& info); - - /* - * @brief Writes a sample given its data only. - * - * This operation will call rti::routing::adapter::StreamWriter::write - * on the underlying rti::routing::adapter::StreamWriter, providing a null - * value for the info sample. The underlying adapter will compute any - * associated metadata from the data sample. - */ - void write(const Data& sample); - - /** - * @brief Creates a new data sample that can be used to write in this - * output. - * - * The data constructor called in this operation depends on the data - * representation kind of the TypeInfo associated with this output. - * If the type representation is a dynamic type, then it will assume - * the following constructor: - * \code Data(const dds::core::xtypes::DynamicType&) \endcode - * - * and will use the type code object downcasted from the value - * returned by TypeInfo::type_representation. - * - * Otherwise: - * \code Data() \endcode - * - * @return A new data sample - */ - Data create_data(); - - /** - * @brief Returns the underlying DDS DataWriter that is part of this - * StreamWriter implementation, assuming this input holds a DDS StreamWriter. - * - * This operation will throw an exception if this output does not hold a - * DDS StreamWriter. - * - * @note The access to the underlying DataWriter is allowed only as long as - * this Output remains enabled. The object representing the DataWriter - * must be invalidated before the output is disabled, otherwise the behavior - * is undefined. - * - * @throw std::exception - * - * @return dds::pub::DataWriter - */ - dds::pub::DataWriter dds_data_writer() - { - DDS_DataWriter *native_writer = - RTI_RoutingServiceOutput_get_dds_writer(output_->native_); - if (native_writer == NULL) { - throw dds::core::InvalidArgumentError( - "invalid argument: input does not hold a DDS StreamWriter"); - } - - typedef dds::pub::DataWriter data_writer_type; - return rti::core::detail::create_from_native_entity( - native_writer); - } - -private: - friend class rti::routing::processor::Route; - - Output *output_; -}; - -template -struct create_data_from_output { - - static Data get(TypedOutput& ) - { - return Data(); - } -}; - - -template -struct create_data_from_output { - - static dds::core::xtypes::DynamicData get(TypedOutput& output) - { - if (output->stream_info().type_info().type_representation_kind() - != TypeRepresentationKind::DYNAMIC_TYPE) { - throw dds::core::PreconditionNotMetError( - "inconsistent data representation kind"); - } - dds::core::xtypes::DynamicType *type_code = - static_cast ( - output->stream_info().type_info().type_representation()); - return dds::core::xtypes::DynamicData(*type_code); - } -}; - - -template -TypedOutput::TypedOutput(Output* output) : output_(output) -{ -} - -template -const rti::routing::StreamInfo& TypedOutput::stream_info() const -{ - return output_->stream_info_; -} - -template -const std::string& TypedOutput::name() const -{ - return output_->name_; -} - -template -TypedOutput* TypedOutput::operator->() -{ - return this; -} - -template -void TypedOutput::write(const Data& sample, const Info& info) -{ - if (!RTI_RoutingServiceOutput_write_sample( - output_->native_, - const_cast (reinterpret_cast (&sample)), - const_cast (reinterpret_cast (&info)))) { - throw dds::core::Error("error writing sample to native output"); - } -} - -template -void TypedOutput::write(const Data& sample) -{ - if (!RTI_RoutingServiceOutput_write_sample( - output_->native_, - const_cast (reinterpret_cast (&sample)), - NULL)) { - throw dds::core::Error("error writing sample to native output"); - } -} - -template -Data TypedOutput::create_data() -{ - return create_data_from_output::get(*this); -} - - -/** - * @brief Convenient definition of a TypedOutput whose data representation - * is DynamicData and info representation is dds::sub::SampleInfo. - * - * These data and info representations are expected be used by most - * rti::routing::adapter::StreamWriter implementations. - */ -typedef TypedOutput DynamicDataOutput; -typedef dds::pub::DataWriter DynamicDataWriter; - -} } } - - -#endif // RTI_ROUTING_PROCESSOR_OUTPUT_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/PortIterator.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/PortIterator.hpp deleted file mode 100644 index c11ee4eef..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/PortIterator.hpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_PORTS_ITERATOR_HPP_ -#define RTI_ROUTING_PROCESSOR_PORTS_ITERATOR_HPP_ - -#include -#include -#include - - -#include -#include -#include -#include - -namespace rti { namespace routing { namespace processor { - -template struct TypedPortType; - -template -struct TypedPortType -{ - typedef TypedInput type; - typedef RTI_RoutingServiceInput native_type; - - static native_type * begin(RTI_RoutingServiceRoute *native_route) - { - return RTI_RoutingServiceRoute_get_first_input(native_route); - } - - static native_type * next( - RTI_RoutingServiceRoute *native_route, - native_type *native) - { - return RTI_RoutingServiceRoute_get_next_input(native_route, native); - } - - static Input* from_native(native_type *native) - { - return static_cast(RTI_RoutingServiceInput_get_user_data( - native)); - } - -}; - -template -struct TypedPortType -{ - typedef TypedOutput type; - typedef RTI_RoutingServiceOutput native_type; - - static native_type * begin(RTI_RoutingServiceRoute *native_route) - { - return RTI_RoutingServiceRoute_get_first_output(native_route); - } - - static native_type * next( - RTI_RoutingServiceRoute *native_route, - native_type *native) - { - return RTI_RoutingServiceRoute_get_next_output(native_route, native); - } - - static Output* from_native(native_type *native) - { - return static_cast(RTI_RoutingServiceOutput_get_user_data( - native)); - } -}; - -template -class PortIterator { -public: - // iterator traits - typedef std::random_access_iterator_tag iterator_category; - typedef typename TypedPortType::type value_type; - typedef value_type reference; - typedef value_type pointer; - typedef std::ptrdiff_t difference_type; - - - explicit PortIterator( - RTI_RoutingServiceRoute *native_route) - : native_route_(native_route) - { - native_ = TypedPortType::begin(native_route); - } - - explicit PortIterator() - : native_route_(NULL), native_(NULL) - { - } - - PortIterator (const PortIterator& other) - : native_route_(other.native_route_), - native_(other.native_) - {} - - PortIterator & operator = (const PortIterator& other) - { - native_route_ = other.native_route_; - native_ = other.native_; - - return *this; - } - - value_type operator*() - { - return TypedPortType::from_native(native_); - } - - value_type operator->() - { - return *(*this); - } - - PortIterator & operator++() - { - native_ = TypedPortType::next( - native_route_, - native_); - - return *this; - } - - PortIterator operator++(int) - { - PortIterator temp(*this); - ++(*this); - return temp; - } - - - friend bool operator<( - const PortIterator & s1, - const PortIterator & s2) - { - return s1.index() < s2.index(); - } - - friend bool operator>( - const PortIterator & s1, - const PortIterator & s2) - { - return s1.index() > s2.index(); - } - - friend bool operator<=( - const PortIterator & s1, - const PortIterator & s2) - { - return s1.index() <= s2.index(); - } - - friend bool operator>=( - const PortIterator & s1, - const PortIterator & s2) - { - return s1.index() >= s2.index(); - } - - friend bool operator==( - const PortIterator & s1, - const PortIterator & s2) - { - return (s1.index() == s2.index()); - } - - friend bool operator!=( - const PortIterator & s1, - const PortIterator & s2) - { - return !(s1 == s2); - } - -private: - int32_t index() const - { - return (native_ == NULL) - ? RTI_INT32_MAX - : TypedPortType::from_native(native_)->index(); - } - - RTI_RoutingServiceRoute *native_route_; - typename TypedPortType::native_type *native_; - -}; - - -} } } - -#endif // RTI_ROUTING_PROCESSOR_PORTS_ITERATOR_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Processor.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Processor.hpp deleted file mode 100644 index e07d2647b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Processor.hpp +++ /dev/null @@ -1,397 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_PROCESSOR_HPP_ -#define RTI_ROUTING_PROCESSOR_PROCESSOR_HPP_ - -#include -#include -#include - -#include "routingservice/routingservice_processor.h" - -#include -#include - -namespace rti { namespace routing { namespace processor { - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::Processor - * - * @brief Processor interface definition. Provides a way to process Route events - * and control the data forwarding process. - * - * A Processor receives event notifications from its Route owner in the form of - * operation callbacks. Each event occurrence will be dispatched to the Processor - * by calling the corresponding method. - * - * Each dispatching method has a signature according to the event kind and data - * it is associated with. Each event is associated with a Route state; hence - * limitations and constraints may apply individually to each method. - * - * Note that throwing an exception while processing any of the - * event notifications is allowed. In this situation, the Route owner will - * reject the events and none of the associated post conditions will be applied, - * including state transitions. - * - * @mtsafety Partially Safe - * All operations on a concrete Processor object are safe and - * always serialized on a given Session. Operations on different - * Processor objects may be called concurrently if they belong - * to different Routes. - * - * @see ProcessorPlugin - * @see Route - */ -class Processor : public rti::routing::UpdatableEntity { -public: - - - /** - * @brief Notification of the \c INPUT_ENABLED event. - * - * This operation is called when an Input enabled event occurs that - * affects any of the inputs contained in the owner Route. - * - * This operation is called right after the affected Input has been enabled. - * - * A running Routing Service instance will produce a log indicating the occurrence - * of the event. For example: - * - * \code - * [.../sessions/Session/routes/Route/inputs/Input1|ENABLE] stream=Example - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * @param[in] input - * The just enabled Input. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p input - * to be automatically disabled right after. - */ - virtual void on_input_enabled( - Route& route, - rti::routing::processor::Input& input) = 0; - - /** - * @brief Notification of the Input disabled event. - * - * This operation is called when an \c INPUT_DISABLED event occurs that - * affects any of the inputs contained in the owner Route. - * - * This operation is called right before the affected Input is disabled. - * - * A running Routing Service instance will produce a log indicating the occurrence - * of the event. For example: - * - * \code - * [.../sessions/Session/routes/Route/inputs/Input1|DISABLE] stream=Example - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * @param[in] input - * The Input about to be disabled. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p input - * to remain enabled. - */ - virtual void on_input_disabled( - Route& route, - rti::routing::processor::Input& input) = 0; - - /** - * @brief Notification of the Output enabled event. - * - * This operation is called when an \c OUTPUT_DISABLED event occurs that - * affects any of the outputs contained in the owner Route. - * - * This operation is called right after the affected Output has been enabled. - * - * A running Routing Service instance will produce a log indicating the occurrence - * of the event. For example: - * - * \code - * [.../sessions/Session/routes/Route/outputs/Output1|ENABLE] stream=Example - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * @param[in] output - * The just enabled output. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p output - * to be automatically disabled right after. - */ - virtual void on_output_enabled( - Route& route, - rti::routing::processor::Output& output) = 0; - - /** - * @brief Notification of the Output disabled event. - * - * This operation is called when an \c OUTPUT_DISABLED event occurs that - * affects any of the outputs contained in the owner Route. - * - * This operation is called right before the affected Output is disabled. - * - * A running Routing Service instance will produce a log indicating the occurrence - * of the event. For example: - * - * \code - * [.../sessions/Session/routes/Route/outputs/Output1|DISABLE] stream=Example - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * @param[in] output - * The Output about to be disabled. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p output - * to remain enabled. - */ - virtual void on_output_disabled( - Route& route, - rti::routing::processor::Output& output) = 0; - - /** - * @brief Notification of the Route started event. - * - * This operation is called right before the Route enters the \c STARTED - * state. At the time this operation is called, all the inputs and outputs - * within the Route are enabled. - * - * A running Routing Service instance will produce a log indicating the - * occurrence of the event. For example: - * \code - * [.../domain_routes/DomainRoute/sessions/Session/routes/Route|START] - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p route - * to remain \c STOPPED. - */ - virtual void on_start(Route& route) = 0; - - /** - * @brief Notification of the Route stopped event. - * - * This operation is called right before the Route enters the \c STOPPED - * state. At the time this operation is called, all the inputs and outputs - * within the Route are still enabled. - * - * A running Routing Service instance will produce a log indicating the - * occurrence of the event. For example: - * \code - * [.../domain_routes/DomainRoute/sessions/Session/routes/Route|STOP] - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p route - * to remain \c STARTED. - * - */ - virtual void on_stop(Route& route) = 0; - - /** - * @brief Notification of the Route \c RUN event. - * - * This operation is called right before the Route enters the \c RUNNING - * state. This operation is called after the Route went to \c STARTED after - * a successful notification to this Processor, - * - * \note - * If the Route was manually paused before via an Administration call, this - * operation will not be called until a manual run operation is performed. - * - * A Routing Service running instance will produce a log indicating the occurrence - * of the event. For example: - * \code - * [.../domain_routes/DomainRoute/sessions/Session/routes/Route|RUN] - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p route - * to remain \c PAUSED. - * - */ - virtual void on_run(Route& route) = 0; - - /** - * @brief Notification of the Route stopped event. - * - * This operation is called right before the Route enters the \c PAUSED - * state. At the time this operation is called, all the inputs and outputs - * within the Route are still enabled. - * - * A Routing Service running instance will produce a log indicating the occurrence - * of the event. For example: - * \code - * [.../domain_routes/DomainRoute/sessions/Session/routes/Route|PAUSE] - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * - * @throw std::exception - * Throwing an error in this operation will cause the \p route - * to remain \c RUNNING. - * - */ - virtual void on_pause(Route& route) = 0; - - /** - * @brief Notification of the Route periodic action event. - * - * This operation is called periodically at the rate specified in the parent - * Session of the Route owner. - * - * Periodic notifications can occur only while the Route is in the \c RUNNING - * state. - * - * Implementations are allowed to access any of the Input and Output of the - * owner Route to read and write data, respectively. - * - * A Routing Service running instance will produce a log indicating the occurrence - * of the event. For example: - * \code - * [.../domain_routes/DomainRoute/sessions/Session/routes/Route] process event=PERODIC_ACTION - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * - * @throw std::exception - * Throwing an error in this operation will produce a log message - * without affecting the Route state and notifications of this event - * to this Processor will keep occurring. - */ - virtual void on_periodic_action(Route& route) = 0; - - /** - * @brief Notification of the Route \c DATA_AVAILABLE event - * - * This operation is called each time any of the inputs contained in the - * owner Route is notified about new data. Notifications of this event can - * occur only while the Route is in the \c RUNNING state. - * - * Implementations are allowed to access any of the Input and Output of the - * owner Route to read and write data, respectively. - * - * A running Routing Service instance will produce a log indicating the - * occurrence of the event. For example: - * \code - * [.../domain_routes/DomainRoute/sessions/Session/routes/Route] process event=DATA_ON_INPUTS - * \endcode - * - * - * @param[in] route - * Route owner that contains this Processor. - * - * @throw std::exception - * Throwing an error in this operation will produce a log message - * without affecting the Route state and notifications of this event - * to this Processor will keep occurring. - * - */ - virtual void on_data_available(Route& route) = 0; - - /** - * @brief Virtual destructor - */ - virtual ~Processor() {} -}; - - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::NoOpProcessor - * - * @brief An empty implementation of the pure virtual interface - * rti::routing::processor::Processor. - * - * Your Processor implementation can inherit from this class and override - * just the methods that are of interest. - */ -class NoOpProcessor : public Processor { - - - virtual void on_input_enabled(Route&, rti::routing::processor::Input&) - { - } - - virtual void on_input_disabled(Route&, rti::routing::processor::Input&) - { - } - - virtual void on_output_enabled(Route&, rti::routing::processor::Output&) - { - } - - virtual void on_output_disabled(Route&, rti::routing::processor::Output&) - { - } - - virtual void on_start(Route&) - { - } - - virtual void on_stop(Route&) - { - } - - virtual void on_run(Route&) - { - } - - virtual void on_pause(Route&) - { - } - - - virtual void on_data_available(Route&) - { - } - - - virtual void on_periodic_action(Route&) - { - } - -}; - -} } } - - -#endif // RTI_ROUTING_PROCESSOR_PROCESSOR_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/ProcessorPlugin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/ProcessorPlugin.hpp deleted file mode 100644 index ad7e42340..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/ProcessorPlugin.hpp +++ /dev/null @@ -1,389 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_PROCESSOR_PLUGIN_HPP_ -#define RTI_ROUTING_PROCESSOR_PROCESSOR_PLUGIN_HPP_ - -#include "routingservice/routingservice_log.h" - -#include -#include -#include -#include - -/** @file - * @brief \product C++ Processor API - */ -/** @defgroup RTI_RoutingServiceProcessorModule RTI Routing Service Processor API - * @ingroup ROUTER - * @brief This module describes the Processor API. - * - * @product rti::routing::processor::Processor are **event-oriented pluggable - * components** that allow you to control the forwarding process that occur within a Route. - * - * ## Development Requirements - * - * | | Linux/macOS Systems | Windows Systems | - * | --------------: | :----------------: | :-------------: | - * | Shared Libraries| librtiroutingservice.so | librtiroutingservice.lib | - * | ^ | librtirsinfrastructure.so | rtirsinfrastructure.lib | - * | ^ | libnddscpp2.so | nddscpp2.lib | - * | ^ | libnddsc.so | nddsc.lib | - * | ^ | libnddscore.so | nddscore.lib | - * | Headers | rti/routing/processor/ProcessorPlugin.hpp || - * - * ## Architecture - * - * A rti::routing::processor::Processor represents a multiple-input, - * multiple-output component attached to a rti::routing::processor::Route, - * which dispatches events to the rti::routing::processor::Processor. - * The figure below shows the role of a rti::routing::processor::Processor within - * @product. - * - * \htmlonly

\endhtmlonly - * \image html RouterProcessorComponent.svg "Overview of a Processor component in @product" width=700px - * \htmlonly
\endhtmlonly - * - * A Processor can access the *N* inputs and *M* outputs of the owner Route. - * Upon event notification, the Processor can read data from any input, - * perform any manipulation on the data, and write it on any of the outputs. - * - * Note in the figure above that any data a Processor writes on an output is - * first transformed with an rti::routing::transf::Transformation before passing - * it to the underlying rti::routing::adapter::StreamWriter. - * - * An example snippet is shown below. The example code is reading data from - * two inputs, merging it together in an intermediate data buffer and writing - * into a single output. - * - * \code{.cpp} - * on_data_available(Route& route) - * { - * auto output = route.output(0); - * auto output_sample = output.create_data(); - * for(const auto& status : route.input(0).take()) { - * auto periodic = route.input(1) - * .select().instance(status.info().instance_handle()).read(); - * output_sample.value( - * "id", - * status.data().get("id")); - * output_sample.value( - * "config", - * status.data().get("config")); - * output_sample.value( - * "latency", - * periodic[0].data().get("latency")); - * output.write(output_sample); - * } - * } - * \endcode - * - * The Processor API component model is shown in figure below. - * - * \htmlonly
\endhtmlonly - * \image html RouterProcessorClass.svg "Processor API component model" width=800px - * \htmlonly
\endhtmlonly - * - * * rti::routing::processor::Processor - * * rti::routing::processor::Route - * * rti::routing::processor::Input - * * rti::routing::processor::Output - * * rti::routing::processor::Selector - * - * ## Event dispatching - * - * A rti::routing::processor::Route will notify its contained - * rti::routing::processor::Processor about the events that affect the Route - * object. Each event kind maps to a virtual operation in the - * rti::routing::processor::Processor interface: - * - * * **Input Enabled**: Event that represents the transition from disables to - * enabled on any of the contained rti::routing::processor::Input. Enabling - * an Input results in the creation of the underlying - * rti::routing::adapter::StreamReader. - * This event is notified through rti::routing::processor::Processor::on_input_enabled. - * - * * **Input Disabled**: Event that represents the transition from enabled to - * disabled on any of the contained rti::routing::processor::Input. Disabling - * an Input results in the deletion of the underlying - * rti::routing::adapter::StreamReader. - * This event is notified through rti::routing::processor::Processor::on_input_disabled. - * - * * **Output Enabled**: Event that represents the transition from disabled to - * enabled on any of the contained rti::routing::processor::Output. Enabling - * an Output results in the creation of the underlying - * rti::routing::transf::Transformation and rti::routing::adapter::StreamWriter. - * This event is notified through rti::routing::processor::Processor::on_output_enabled. - * - * * **Output Disabled**: Event that represents the transition from enabled to - * disabled on any of the contained rti::routing::processor::Output. Disabling - * an Output results in the deletion of the underlying - * rti::routing::transf::Transformation and rti::routing::adapter::StreamWriter. - * This event is notified through rti::routing::processor::Processor::on_output_disabled. - * - * * **Route Started**: This event indicates that the owner - * rti::routing::processor::Route has enabled all inputs and outputs. - * This event is notified through rti::routing::processor::Processor::on_start. - * - * * **Route Stopped**: This event indicates that the owner - * rti::routing::processor::Route is about to disable at least one of its - * inputs or outputs. - * This event is notified through rti::routing::processor::Processor::on_stop. - * - * * **Route Running**: This event indicates that the owner - * rti::routing::processor::Route is ready to provide user event - * notifications. - * This event is notified through rti::routing::processor::Processor::on_run. - * - * * **Route Paused**: This event indicates that the owner - * rti::routing::processor::Route will temporarily stop providing user - * event notifications. - * This event is notified through rti::routing::processor::Processor::on_pause. - * - * * **Data Available**: This user event indicates at least one of the inputs - * within the owner rti::routing::processor::Route has received new data. - * This event is notified through rti::routing::processor::Processor::on_data_available. - * - * * **Periodic Action**: This user event represents a periodic notification, - * at a rate configured in the parent Session of the owner - * rti::routing::processor::Route. - * This event is notified through rti::routing::processor::Processor::on_periodic_action. - * - * - * ## Threading - * - * A rti::routing::processor::Route dispatches all the events to its contained - * processors **sequentially**, from within one of the parent Session's threads. - * For any given Route, and hence a Processor, it is guaranteed that only - * one event is dispatched at at time. That is, the operations on the Processor - * are never called concurrently for a given Route. - * - * A parent Session with *L* threads can only process one Route at - * a time but it can dispatch different Routes concurrently. Namely, it can - * dispatch up to *L* Routes concurrently. You should keep this behavior in mind - * for implementations that share state between Processor objects. - * - * ## Constraints - * - * There are several constraints that affect the behavior and relationship - * of the Processor API components: - * - * * A Route can have one and only one Processor. Alternatively, *semantically* a - * Processor can belong to one and only one Route. That is, each Route will - * call rti::routing::processor::ProcessorPlugin::create_processor and - * rti::routing::processor::ProcessorPlugin::delete_processor on the - * corresponding plug-in instance, if the implementation is returning the - * same physical object. - * - * * An Input/Output can belong to one and only one Route. Thus, they cannot - * be shared across different Routes. Alternatively, operations on an - * Input, Output and Route can be performed only from within the associated - * Processor. It is forbidden to pass Input, Output and Route objects between - * Processors - */ - - -namespace rti { namespace routing { namespace processor { - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::ProcessorPlugin - * @brief The top-level plug-in class. - * - * Represents a factory of Processor. - */ -class ProcessorPlugin { -public: - - /** - * @brief Creates a Route Processor. - * - * This function is called when the Route containing the Processor - * is enabled. - * - * A Routing Service running instance will product a log indicating the - * occurrence of this event. For example: - * \code - * [.../domain_routes/DomainRoute|START|/sessions/Session|START|/routes/Route|ENABLE] - * \endcode - * - * - * Required: yes - * - * @param route - * @rs_st_in An object representation of the Route that owns - * the Processor. - * @param properties - * @rs_st_in Configuration properties for the Processor. - * These properties corresponds to the properties specified within - * the tag <processor>. - * - * @return New Processor if successful. Cannot return @null_value. - * @throw std::exception - * @mtsafety Safe - */ - virtual Processor * create_processor( - Route& route, - const rti::routing::PropertySet& properties) = 0; - - /** - * @brief Deletes a Route Processor. - * - * This function is called when the Route containing the Processor - * is disabled. - * - * Required: yes - * - * @param route - * @rs_st_in An object representation of the Route that owns - * the Processor. - * @param processor - * @rs_st_in Processor object to be deleted. - * - * @throw std::exception - * @mtsafety Safe - */ - virtual void delete_processor( - Route& route, - Processor *processor) = 0; - - /** - * @return The version of this TransformationPlugin. - * - * The version is used for logging purposes. It allows you to track which - * version of the TransformationPlugin the @product is using. - * - * Default implementation of this operation returns the version of the - * required Connext libraries. - */ - virtual rti::config::LibraryVersion get_version() const - { - return rti::config::LibraryVersion(); - } - - /** - * @brief Virtual destructor - */ - virtual ~ProcessorPlugin() {} - -}; - -} } } - - -#include - - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @brief Utility macro that declares a native extern function that can - * be used to load a ProcessorPlugin through a shared library. - * - * The prototype of the function is given by a native definition of the - * create operation. - * - * To register a ProcessorPlugin with @product, you must use the tag - * <processor_plugin> within <plugin_library>. For example: - * - * \code - * - * ... - * - * - * myprocessor - * - * MyProcessorPlugin_create - * - * - * ... - * - * ... - * - * ... - * - * ... - * - * \endcode - * - * Once a ProcessorPlugin is registered, a Route can use it to create a - * Processor. - * - * For example: - * - * \code - * - * ... - * - * - * - * - * my_property_name - * my_property_value - * - * - * - * - * - * Square - * ShapeType - * - * - * Circle - * ShapeType - * - * - * Triangle - * ShapeType - * - * - * \endcode - * - * For additional information on configuring Processors, see the - * \ref_url_routing_service_users_manual. - * - * @param PROCESSOR_CLASS - * Class name of a ProcessorPlugin implementation - */ -#define RTI_PROCESSOR_PLUGIN_CREATE_FUNCTION_DECL(PROCESSOR_CLASS) \ -extern "C" RTI_USER_DLL_EXPORT struct RTI_RoutingServiceProcessorPlugin* \ - PROCESSOR_CLASS ## _create_processor_plugin(\ - const struct RTI_RoutingServiceProperties *, \ - RTI_RoutingServiceEnvironment *); \ - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @brief Utility macro that implements the ProcessorPlugin entry point - * declared with RTI_PROCESSOR_PLUGIN_CREATE_FUNCTION_DECL. - */ -#define RTI_PROCESSOR_PLUGIN_CREATE_FUNCTION_DEF(PROCESSOR_CLASS) \ -struct RTI_RoutingServiceProcessorPlugin * PROCESSOR_CLASS ## _create_processor_plugin( \ - const struct RTI_RoutingServiceProperties * native_properties, \ - RTI_RoutingServiceEnvironment *environment) \ -{ \ - PropertySet properties; \ - rti::routing::PropertyAdapter::add_properties_from_native(\ - properties,\ - native_properties); \ - try { \ - return rti::routing::processor::detail::ProcessorPluginForwarder::create_plugin(\ - new PROCESSOR_CLASS(properties)); \ - } catch (const std::exception& ex) {\ - RTI_RoutingServiceEnvironment_set_error(\ - environment,\ - "%s",\ - ex.what());\ - } catch (...) {}\ - \ - return NULL; \ -} - - - -#endif // RTI_ROUTING_PROCESSOR_PROCESSOR_PLUGIN_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Query.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Query.hpp deleted file mode 100644 index 6226af9bf..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Query.hpp +++ /dev/null @@ -1,138 +0,0 @@ -/* $Id$ - -(c) Copyright, Real-Time Innovations, 2015-2016. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. - - -============================================================================= */ - -#ifndef RTI_ROUTING_PROCESSOR_QUERY_HPP_ -#define RTI_ROUTING_PROCESSOR_QUERY_HPP_ - -#include "routingservice/routingservice_processor.h" - -#include -#include - - -namespace rti { namespace routing { namespace processor { - -class Input; - -class QueryHolder : public rti::core::detail::RetainableType{ -public: - - QueryHolder() : input_(NULL), query_data_(NULL) - { - } - - QueryHolder(RTI_RoutingServiceInput *input, const dds::topic::Filter& the_filter) - : input_(input), - query_data_(NULL) - { - filter(the_filter); - } - - ~QueryHolder() - { - if (query_data_ != NULL) { - /* - * Ignore the error. We can't throw in the destructor and this - * layer does not log anything - */ - (void) RTI_RoutingServiceInput_delete_content_query( - input_, - query_data_); - } - } - - void filter(const dds::topic::Filter& filter) - { - RTI_RoutingServiceSelectorContent content = - RTI_RoutingServiceSelectorContent_INITIALIZER; - content.expression = (char *) filter.expression().c_str(); - rti::core::native_conversions::to_native( - content.expression_parameters, - filter->parameters()); - query_data_ = RTI_RoutingServiceInput_create_content_query( - input_, - query_data_, - &content); - DDS_StringSeq_finalize(&content.expression_parameters); - if (query_data_ == NULL) { - throw dds::core::Error("error creating content query from native input"); - } - } - - RTI_RoutingServiceInput *input_; - void* query_data_; -}; - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::Query - * - * @brief Encapsulates a content query to select data from a - * rti::routing::adapter::StreamReader. - * - * Note that syntax for the query filter is StreamReader implementation - * dependent. For the DDS Adapter case, the syntax corresponds to that - * of the SQL filter. - * - * A Query object holds a custom query obtained by calling - * rti::routing::adapter::StreamReader::create_content_query. Likewise, - * the deletion of a Query object will call - * rti::routing::adapter::StreamReader::delete_content_query. - */ -class Query : public dds::core::Reference { -public: - typedef dds::core::Reference Base; - OMG_DDS_REF_TYPE_NOTYPENAME( - Query, - dds::core::Reference, - rti::routing::processor::QueryHolder); - - explicit Query(Base::DELEGATE_REF_T reference) : Base(reference) - { - if (this->delegate()) { - this->delegate()->remember_reference(this->delegate()); - } - } - - /** - * @brief Creates a Query described by a filter on an input. - * - * @param[in] input The native Input to query the data from. - * @param[in] filter Description of the content query based on an expression - * and parameters. - * - * @see dds::topic::Filter - */ - Query(RTI_RoutingServiceInput *input, const dds::topic::Filter& filter) - : Base(new QueryHolder(input, filter)) - { - this->delegate()->remember_reference(this->delegate()); - } - - - /** - * @brief Updates the current Query content filter. - * - * This operation will call - * rti::routing::adapter::StreamReader::create_content_query providing - * the current query content data this Query holds. - */ - void filter(const dds::topic::Filter& filter) - { - this->delegate()->filter(filter); - } -}; - -} } } - -#endif // RTI_ROUTING_PROCESSOR_QUERY_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Route.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Route.hpp deleted file mode 100644 index a949ca765..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/Route.hpp +++ /dev/null @@ -1,555 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_ROUTE_HPP_ -#define RTI_ROUTING_PROCESSOR_ROUTE_HPP_ - -#include -#include -#include - -#include "routingservice/routingservice_processor.h" -#include "routingservice/routingservice_processor_impl.h" - -#include -#include -#include -#include -#include -#include -#include - -namespace rti { namespace routing { namespace processor { - -namespace detail { - -class ProcessorForwarder; - -} - -class Route; - -template struct port_list; - -template <> struct port_list -{ - static std::vector& get(Route& route); -}; - -template <> struct port_list -{ - static std::vector& get(Route& route); -}; - -/** @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::Route - * - * @brief Representation of the Route object that owns a Processor. - * - * This class provides an interface to access the capabilities of a Route, such - * as retrieving any of its inputs and outputs. Usage of this class - * is restricted within the Processor context where the object is passed. - * - * An example of how to use this object is shown below. This example illustrates - * a simple use case of reading from all inputs and writing to all outputs, - * assuming that the sample data and info have the same representation and - * type. - * - * \code{.c++} - * using dds::core::xtypes::DynamicData; - * using dds::sub::SampleInfo; - * using namespace rti::routing::processor; - * - * ... - * - * for (auto input : route.inputs()) { - * LoanedSamples samples = input->read(); - * - * for (auto output : route.outputs()) { - * for(auto sample = samples) { - * output.write(sample.data(), sample.info()); - * } - * } - * } - * \endcode - */ -class Route { - -public: - - template - struct Inputs { - typedef PortIterator iterator; - - Inputs(RTI_RoutingServiceRoute *native_route) - : native_route_(native_route) - { - } - - iterator begin() - { - return iterator(native_route_); - } - - iterator end() - { - return iterator(); - } - - private: - RTI_RoutingServiceRoute *native_route_; - }; - - template - struct Outputs { - typedef PortIterator iterator; - - Outputs(RTI_RoutingServiceRoute *native_route) - : native_route_(native_route) - { - } - - iterator begin() - { - return iterator(native_route_); - } - - iterator end() - { - return iterator(); - } - - private: - RTI_RoutingServiceRoute *native_route_; - }; - - - /** - * @brief Returns the total number of inputs in this Route. - * - */ - int32_t input_count() const - { - return RTI_RoutingServiceRoute_get_input_count(native_route_); - } - - /** - * @brief Returns the total number of outputs in this Route. - * - */ - int32_t output_count() const - { - return RTI_RoutingServiceRoute_get_output_count(native_route_); - } - - /** - *@brief Checks whether the Input at the specified index is enabled - * - */ - bool input_enabled(int32_t index) const - { - return RTI_RoutingServiceRoute_is_input_enabled(native_route_, index) - ? true - : false; - } - - /** - *@brief Checks whether the Input at the specified index is enabled - * - */ - bool output_enabled(int32_t index) const - { - return RTI_RoutingServiceRoute_is_output_enabled(native_route_, index) - ? true - : false; - } - - /** - * @brief Returns the Input object at the specified index. - * - * Input indexes are assigned in increasing creation order, starting at 0. - * The creation order is the same order than the inputs are defined within - * the Route configuration. - * - * The returned object can be used to construct the appropriate TypedInput, - * which can be used for reading data. - * - * @param[in] index - * The index of the Input to be retrieved. - * - * @return The Input at the specified index. - * - * @see TypedInput - * - */ - Input& input(int32_t index) - { - return *(get_input_at_index(index)); - } - - /** - * @brief Returns the Input object with the specified name or throws an - * exception if the input with the given name is not found or if it is - * found but is not enabled. - * - * \b NOTE: The condition that the input must be enabled will be removed - * in a future version. This is being tracked with issue ID ROUTING-1131. - * - * @param[in] name The input configuration name - * - * @see TypedInput::name - * @throw std::logic_error - */ - Input& input(const std::string& name) - { - return *(lookup_input(name)); - } - - /** - * @brief Returns the TypedInput object at the specified index. - * - * The returned object is typed so it can read samples whose type is - * \p DataRep for data, and \p InfoRep for info. These types must - * match the expected type representations of the underlying - * rti::routing::adapter::StreamReader. - * - * Typically, these template arguments are typed - * dds::core::xtypes::DynamicData and dds::sub::SampleInfo, respectively. - * - * @warning This operation performs no type integrity check. It is - * responsibility of the caller to ensure the provided template - * arguments match with the expected types of the input. Otherwise - * behavior accessing the input is undefined. - * - * @return The TypedInput object at the specified index. - * - * @see input(int32_t) - * @see TypedInput - */ - template - TypedInput input(int32_t index) - { - return &input(index); - } - - /** - * @brief Same as input(int32_t) with - * InfoRep = dds::sub::SampleInfo. - * - */ - template - TypedInput input(int32_t index) - { - return input(index); - } - - /** - * @brief Same as input(int32_t) but using - * the configuration name of the input. - * - */ - template - TypedInput input(const std::string& name) - { - return &input(name); - } - - /** - * @brief Same as input(std::string&) with - * InfoRep = dds::sub::SampleInfo. - */ - template - TypedInput input(const std::string& name) - { - return input(name); - } - - /** - * @brief Returns the Output object at the specified index. - * - * Output indexes are assigned in increasing creation order, starting at 0. - * The creation order is the same order than the outputs are defined within - * the Route configuration. - * - * The returned object can be used to construct the appropriate TypedOutput, - * which can be used for writing data. - * - * @param[in] index - * The index of the Output to be retrieved. - * - * @return The Output at the specified index. - * - * @see TypedOutput - * - */ - Output& output(int32_t index) - { - return *(get_output_at_index(index)); - } - - /** - * @brief Returns the Output object with the specified name or throws an - * exception if the output with the given name is not found or if it is - * found but is not enabled. - * - * \b NOTE: The condition that the input must be enabled will be removed - * in a future version. This is being tracked with issue ID ROUTING-1131. - * - * @param[in] name The output configuration name - * - * @see TypedOutput::name - * @throw std::logic_error - */ - Output& output(const std::string& name) - { - return *(lookup_output(name)); - } - - /** - * @brief Returns the TypedOutput object at the specified index. - * - * The returned object is typed so it can write samples whose type is - * \p DataRep for data, and \p InfoRep for info. These types must - * match the expected type representations of the underlying - * rti::routing::adapter::StreamWriter. - * - * Typically, these template arguments are typed - * dds::core::xtypes::DynamicData and dds::sub::SampleInfo, respectively. - * - * @warning This operation performs no type integrity check. It is - * responsibility of the caller to ensure the provided template - * arguments match with the expected types of the output. Otherwise - * behavior accessing the output is undefined. - * - * @return The TypedOutput object at the specified index. - * - * @see input(int32_t) - */ - template - TypedOutput output(int32_t index) - { - return &output(index); - } - - /** - * @brief Same as output(int32_t) with - * InfoRep = dds::sub::SampleInfo. - * - */ - template - TypedOutput output(int32_t index) - { - return output(index); - } - - /** - * @brief Same as output(int32_t) but using - * the configuration name of the output. - * - */ - template - TypedOutput output(const std::string& name) - { - return &output(name); - } - - /** - * @brief Same as output(std::string&) with - * InfoRep = dds::sub::SampleInfo. - */ - template - TypedOutput output(const std::string& name) - { - return output(name); - } - - /** - * @brief Returns an accessor for the contained inputs. - * - * The returned object that allows iterating over the - * contained inputs, treating them as TypedInput. - * - * @see Inputs - * @see TypedInput input(int32_t index) - */ - template - Inputs inputs() - { - return Inputs(native_route_); - } - - /** - * @brief Same as Inputs inputs() with - * InfoRep = dds::sub::SampleInfo. - */ - template - Inputs inputs() - { - return inputs(); - } - - /** - * @brief Returns an accessor for the contained outputs. - * - * The returned object that allows iterating over the - * contained outputs, treating them as TypedOutput. - * - * @see Outputs - * @see TypedOutput input(int32_t index) - */ - template - Outputs outputs() - { - return Outputs(native_route_); - } - - /** - * @brief Same as Inputs outputs() with - * InfoRep = dds::sub::SampleInfo. - */ - template - Outputs outputs() - { - return outputs(); - } - - /** - * - * @brief Changes the event period of this Route. - * - * This operation can be called many times within the same periodic event, - * in which only the last call will have effect. - * - * The operation will enable the periodic event in this route if this - * operation is called for the first time in a route with no period set - * in the configuration. - * - * @param[in] period New session period - */ - void period(const dds::core::Duration& period) - { - struct DDS_Duration_t native_period = DDS_DURATION_ZERO; - rti::core::native_conversions::to_native(native_period, period); - RTI_RoutingServiceRoute_set_period( - native_route_, - &native_period); - } - - dds::core::Duration period() const - { - struct DDS_Duration_t native_period = DDS_DURATION_ZERO; - RTI_RoutingServiceRoute_get_period( - native_route_, - &native_period); - - return rti::core::native_conversions::from_native(native_period); - } - - /** - * - * @brief Returns the fully qualified of this Route, derived from the configuration. - * - */ - const std::string& full_name() const - { - return full_name_; - } - - -private: - friend class detail::ProcessorForwarder; - friend class Output; - friend struct port_list; - friend struct port_list; - - typedef std::vector::iterator private_input_it; - typedef std::vector::iterator private_output_it; - - Route& operator= (const Route& other); - - Route(RTI_RoutingServiceRoute *native_route, - RTI_RoutingServiceEnvironment *native_env) - : native_route_(native_route), - native_env_(native_env) - { - const char *native_full_name = - RTI_RoutingServiceRoute_get_full_name(native_route); - if (native_full_name == nullptr) { - throw dds::core::InvalidArgumentError( - "Native Route has invalid full name"); - } - full_name_ = native_full_name; - } - - Input* get_input_at_index(int32_t index) - { - RTI_RoutingServiceInput *native_input = - RTI_RoutingServiceRoute_get_input_at(native_route_, index); - if (native_input == NULL) { - throw dds::core::InvalidArgumentError( - RTI_RoutingServiceEnvironment_get_error_message(native_env_)); - } - - return static_cast(RTI_RoutingServiceInput_get_user_data(native_input)); - } - - Output* get_output_at_index(int32_t index) - { - RTI_RoutingServiceOutput *native_output = - RTI_RoutingServiceRoute_get_output_at(native_route_, index); - if (native_output == NULL) { - throw dds::core::InvalidArgumentError( - RTI_RoutingServiceEnvironment_get_error_message(native_env_)); - } - - return static_cast(RTI_RoutingServiceOutput_get_user_data(native_output)); - } - - - Input* lookup_input(const std::string& name) - { - RTI_RoutingServiceInput *native_input = - RTI_RoutingServiceRoute_lookup_input_by_name( - native_route_, - name.c_str()); - if (native_input == NULL) { - throw dds::core::InvalidArgumentError( - RTI_RoutingServiceEnvironment_get_error_message(native_env_)); - } - return static_cast(RTI_RoutingServiceInput_get_user_data(native_input)); - - } - - Output* lookup_output(const std::string& name) - { - RTI_RoutingServiceOutput *native_output = - RTI_RoutingServiceRoute_lookup_output_by_name( - native_route_, - name.c_str()); - if (native_output == NULL) { - throw dds::core::InvalidArgumentError( - RTI_RoutingServiceEnvironment_get_error_message(native_env_)); - } - return static_cast(RTI_RoutingServiceOutput_get_user_data(native_output)); - - } - -private: - RTI_RoutingServiceRoute *native_route_; - RTI_RoutingServiceEnvironment *native_env_; - std::string full_name_; - -}; - - -} } } - -#endif // RTI_ROUTING_PROCESSOR_ROUTE_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/SampleIterator.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/SampleIterator.hpp deleted file mode 100644 index 7c9fe0f0d..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/SampleIterator.hpp +++ /dev/null @@ -1,275 +0,0 @@ -/* $Id$ - -(c) Copyright, Real-Time Innovations, 2014-2016. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. - - -modification history --------------------- -1.0a,05may14,acr Added ValidSampleIterator and valid_samples helper -1.0a,20mar13,acr Created -============================================================================= */ - -#ifndef RTI_ROUTING_PROCESSOR_SAMPLE_ITERATOR_HPP_ - #define RTI_ROUTING_PROCESSOR_SAMPLE_ITERATOR_HPP_ - - - #include - #include - -namespace rti { -namespace routing { -namespace processor { - -/*i - * @brief Tag type to emulate/indicate that sample infos are not available - */ -struct no_sample_info_t { -}; - -/** - * @ingroup RTI_RoutingServiceProcessorModule - * - * @class rti::routing::processor::SampleIterator - * @brief A random-access iterator of LoanedSample - * - * @see rti::routing::processor::LoanedSamples - */ -template -class SampleIterator { -public: - // iterator traits - using iterator_category = std::random_access_iterator_tag; - using value_type = const LoanedSample; - using reference = value_type; - using pointer = value_type; - using difference_type = std::size_t; - using SampleSeqType = RTI_RoutingServiceSample*; - using InfoSeqType = RTI_RoutingServiceSampleInfo*; - -private: - static no_sample_info_t *_null_info_scrachtpad[1]; - static InfoSeqType _null_info_seq; - static difference_type _null_info_pos; - -public: - SampleIterator() - : _sample_seq(0), - _info_seq(0), - _length(0), - _pos(0), - _info_pos(_pos) - { - } - - SampleIterator( - const SampleSeqType sample_seq, - const InfoSeqType info_seq, - int length, - int position = 0) - : _sample_seq(sample_seq), - _info_seq(info_seq == NULL ? _null_info_seq : info_seq), - _length(length), - _info_pos(info_seq == NULL ? _null_info_pos : _pos) - { - if (position < 0) { - throw dds::core::IllegalOperationError("SampleIterator out of range"); - } - - _pos = static_cast(position); - } - - SampleIterator(const SampleIterator & other) - : _sample_seq(other._sample_seq), - _info_seq(other._info_seq), - _length(other._length), - _pos(other._pos), - _info_pos(other._info_pos) - { - } - - SampleIterator & operator=(const SampleIterator & other) - { - _sample_seq = other._sample_seq; - _info_seq = other._info_seq; - _length = other._length; - _pos = other._pos; - _info_pos = other._info_pos; - - return *this; - } - - value_type operator*() const - { - return value_type(_sample_seq[_pos], _info_seq[_info_pos]); - } - - value_type operator->() const - { - return value_type(_sample_seq[_pos], _info_seq[_info_pos]); - } - - value_type operator[](difference_type offset) const - { - return (_info_seq == _null_info_seq) - ? value_type(_sample_seq[_pos], NULL) - : value_type(_sample_seq[_pos + offset], _info_seq[_info_pos + offset]); - } - -/* - * Windows defines min and max in one of the Windows headers, and they - * collide with the max() definition we use below - */ -#ifdef RTI_WIN32 -#undef max -#undef min -#endif - SampleIterator & operator++() - { - if (_pos == std::numeric_limits::max()) { - throw dds::core::IllegalOperationError("SampleIterator out of range"); - } - - ++_pos; - return *this; - } - - SampleIterator operator++(int) - { - SampleIterator temp(*this); - ++(*this); - return temp; - } - - SampleIterator & operator--() - { - if (_pos == std::numeric_limits::min()) { - throw dds::core::IllegalOperationError("SampleIterator out of range"); - } - - --_pos; - return *this; - } - - SampleIterator operator--(int) - { - SampleIterator temp(*this); - --(*this); - return temp; - } - - SampleIterator & operator-=(difference_type i) - { - if (i > _pos) { - throw dds::core::IllegalOperationError("SampleIterator out of range"); - } - - _pos -= i; - return *this; - } - - SampleIterator & operator+=(difference_type i) - { - if ((std::numeric_limits::max() - _pos) < i) { - throw dds::core::IllegalOperationError("SampleIterator out of range"); - } - - _pos += i; - return *this; - } - - friend SampleIterator operator-( - const SampleIterator& si, - difference_type i) - { - SampleIterator temp(si); - temp -= i; - return temp; - } - - friend SampleIterator operator+( - const SampleIterator& si, - difference_type i) - { - SampleIterator temp(si); - temp += i; - return temp; - } - - friend difference_type operator-( - const SampleIterator& s1, - const SampleIterator& s2) - { - return s1._pos - s2._pos; - } - - friend bool operator<(const SampleIterator & s1, - const SampleIterator & s2) - { - return s1._pos < s2._pos; - } - - friend bool operator>(const SampleIterator & s1, - const SampleIterator & s2) - { - return s1._pos > s2._pos; - } - - friend bool operator<=(const SampleIterator & s1, - const SampleIterator & s2) - { - return s1._pos <= s2._pos; - } - - friend bool operator>=(const SampleIterator & s1, - const SampleIterator & s2) - { - return s1._pos >= s2._pos; - } - - friend bool operator==(const SampleIterator & s1, - const SampleIterator & s2) - { - return (s1._sample_seq == s2._sample_seq) && (s1._pos == s2._pos); - } - - friend bool operator!=(const SampleIterator & s1, - const SampleIterator & s2) - { - return !(s1 == s2); - } - - bool is_end() const - { - return (_length == _pos); - } - - // Keep these members public otherwise some of the - // converting constructors will not compile. -public: - SampleSeqType _sample_seq; - InfoSeqType _info_seq; - int _length; - difference_type _pos; - difference_type& _info_pos; -}; - - -template -std::size_t SampleIterator::_null_info_pos = 0; - -template -no_sample_info_t * SampleIterator::_null_info_scrachtpad[1] = {NULL}; - -template -typename SampleIterator::InfoSeqType SampleIterator::_null_info_seq = -reinterpret_cast (SampleIterator::_null_info_scrachtpad); - -} } } - -#endif // RTI_ROUTING_PROCESSOR_SAMPLE_ITERATOR_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorForwarder.hpp deleted file mode 100644 index aa18ad56c..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorForwarder.hpp +++ /dev/null @@ -1,353 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_DETAIL_PROCESSOR_FORWARDER_HPP_ -#define RTI_ROUTING_PROCESSOR_DETAIL_PROCESSOR_FORWARDER_HPP_ - -#include - -#include "rti/apputils/ServiceException.hpp" - -#include "routingservice/routingservice_processor_impl.h" -#include -#include -#include -#include -#include - -namespace rti { namespace routing { namespace processor { namespace detail { - -class ProcessorForwarder { - -private: - - template - class ScopedPort { - - public: - ScopedPort(Route& route, int32_t index, NATIVE *native) - : route_(route), - port_(new PORT(native, index, route.native_route_)) - { - } - - PORT* get() - { - return port_; - } - - void clear() - { - port_ = NULL; - } - - ~ScopedPort() - { - if (port_ != NULL) { - delete port_; - port_ = NULL; - } - } - - private: - Route& route_; - PORT *port_; - }; - -public: - - static RTI_RoutingServiceProcessor * create_native( - ProcessorPlugin *plugin, - RTI_RoutingServiceRoute *native_route, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - try { - using rti::routing::detail::ScopedForwarder; - - std::map properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - - ProcessorForwarder *forwarder = new ProcessorForwarder( - native_route, - environment); - ScopedForwarder scoped( - plugin, - forwarder, - environment); - forwarder->processor_ = plugin->create_processor( - forwarder->route(), - properties); - RTI_ROUTING_THROW_ON_NULL(forwarder->processor_); - - scoped.release(); - - // TRUST-134: the forwarder is not leaked here. It might be leaked - // if delete_native() were not to be called, but Routing Service - // will make sure that is not the case - - /* coverity[leaked_storage : FALSE] */ - return forwarder->native(); - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - return NULL; - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - return NULL; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return NULL; - } - - - } - - static void delete_native( - ProcessorPlugin *plugin, - RTI_RoutingServiceProcessor *native_processor, - RTI_RoutingServiceEnvironment *environment) - { - ProcessorForwarder *processor_forwarder = - static_cast(native_processor->processor_data); - try { - if (processor_forwarder->processor_ != NULL) { - plugin->delete_processor( - processor_forwarder->route_, - processor_forwarder->processor_); - processor_forwarder->processor_ = NULL; - } - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - delete processor_forwarder; - } - - - static void forward_on_route_event( - void *native_processor_data, - RTI_RoutingServiceRouteEvent *native_route_event, - RTI_RoutingServiceEnvironment *environment) - { - - ProcessorForwarder *forwarder = - static_cast(native_processor_data); - - try { - - // build up wrapper objects based on the event - switch (RTI_RoutingServiceRouteEvent_get_kind(native_route_event)) { - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_DATA_ON_INPUTS: - forwarder->processor_->on_data_available(forwarder->route()); - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_PERIODIC_ACTION: - - forwarder->processor_->on_periodic_action(forwarder->route()); - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_INPUT_ENABLED: - { - void *affected_entity = - RTI_RoutingServiceRouteEvent_get_affected_entity(native_route_event); - void *index = - RTI_RoutingServiceRouteEvent_get_event_data(native_route_event); - /* ScopedPort helps to delete the Input if an exception occurs */ - ScopedPort port( - forwarder->route_, - *(static_cast(index)), - static_cast(affected_entity)); - forwarder->processor_->on_input_enabled( - forwarder->route(), - *port.get()); - RTI_RoutingServiceInput_set_user_data( - static_cast(affected_entity), - port.get()); - /* - * Input successfully enabled, so clear the ScopedPort so it - * doesn't delete it - */ - port.clear(); - - } - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_INPUT_DISABLED: - { - - void *affected_entity = - RTI_RoutingServiceRouteEvent_get_affected_entity(native_route_event); - RTI_RoutingServiceInput *native_input = - static_cast(affected_entity); - Input *input = reinterpret_cast( - RTI_RoutingServiceInput_get_user_data(native_input)); - forwarder->processor_->on_input_disabled( - forwarder->route(), - *input); - RTI_RoutingServiceInput_set_user_data(native_input, NULL); - delete input; - } - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_OUTPUT_ENABLED: - { - void *affected_entity = - RTI_RoutingServiceRouteEvent_get_affected_entity(native_route_event); - void *index = - RTI_RoutingServiceRouteEvent_get_event_data(native_route_event); - /* ScopedPort helps to delete the Output if an exception occurs */ - ScopedPort port( - forwarder->route_, - *(static_cast(index)), - static_cast(affected_entity)); - forwarder->processor_->on_output_enabled( - forwarder->route(), - *port.get()); - RTI_RoutingServiceOutput_set_user_data( - static_cast(affected_entity), - port.get()); - /* - * Output successfully enabled, so clear the ScopedPort so it - * doesn't delete it - */ - port.clear(); - - } - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_OUTPUT_DISABLED: - { - void *affected_entity = - RTI_RoutingServiceRouteEvent_get_affected_entity(native_route_event); - RTI_RoutingServiceOutput *native_output = - static_cast(affected_entity); - Output *output = reinterpret_cast( - RTI_RoutingServiceOutput_get_user_data(native_output)); - forwarder->processor_->on_output_disabled( - forwarder->route(), - *output); - RTI_RoutingServiceOutput_set_user_data(native_output, NULL); - delete output; - } - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_STARTED: - - forwarder->processor_->on_start(forwarder->route()); - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_STOPPED: - - forwarder->processor_->on_stop(forwarder->route()); - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_RUNNING: - - forwarder->processor_->on_run(forwarder->route()); - break; - - case RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_PAUSED: - - forwarder->processor_->on_pause(forwarder->route()); - break; - - default: - break; - }; - - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "%s", - "unexpected exception"); - } - } - - static void forward_update( - void *native_processor_data, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - - ProcessorForwarder *processorForwarder = - static_cast (native_processor_data); - - rti::routing::detail::UpdatableEntityForwarder::update( - processorForwarder->processor_, - native_properties, - environment); - } - - RTI_RoutingServiceProcessor* native() - { - return &native_; - } - -private: - - ProcessorForwarder( - RTI_RoutingServiceRoute *native_route, - RTI_RoutingServiceEnvironment *native_env) : - processor_(NULL), - route_(native_route, native_env) - { - RTIOsapiMemory_zero(&native_, sizeof(native_)); - /* initialize native implementation */ - native_.processor_data = static_cast(this); - native_.on_route_event = ProcessorForwarder::forward_on_route_event; - native_.update = ProcessorForwarder::forward_update; - } - - rti::routing::processor::Route& route() - { - return route_; - } - - ~ProcessorForwarder() - { - } - -private: - RTI_RoutingServiceProcessor native_; - Processor *processor_; - rti::routing::processor::Route route_; - -}; - -}}}} - -#endif // RTI_ROUTING_PROCESSOR_DETAIL_PROCESSOR_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorPluginForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorPluginForwarder.hpp deleted file mode 100644 index 51f2561f5..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/processor/detail/ProcessorPluginForwarder.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_PROCESSOR_PLUGIN_DETAIL_PROCESSOR_PLUGIN_FORWARDER_HPP_ -#define RTI_ROUTING_PROCESSOR_PLUGIN_DETAIL_PROCESSOR_PLUGIN_FORWARDER_HPP_ - -#include - -#include -#include - -namespace rti { namespace routing { namespace processor { namespace detail { - - -class ProcessorPluginForwarder { -public: - - static RTI_RoutingServiceProcessorPlugin * create_plugin( - ProcessorPlugin *plugin) - { - RTI_RoutingServiceProcessorPlugin *native_plugin = NULL; - RTIOsapiHeap_allocateStructure( - &native_plugin, - struct RTI_RoutingServiceProcessorPlugin); - rti::core::check_create_entity( - native_plugin, - "RTI_RoutingServiceProcessorPlugin"); - RTI_RoutingServiceProcessorPlugin_initialize(native_plugin); - - // Set adapter version - rti::config::LibraryVersion version = plugin->get_version(); - native_plugin->plugin_version.major = version.major_version(); - native_plugin->plugin_version.minor = version.minor_version(); - native_plugin->plugin_version.release = version.release_version(); - - // Initialize native implementation - native_plugin->processor_plugin_data = - static_cast(plugin); - native_plugin->plugin_delete = - ProcessorPluginForwarder::delete_plugin; - native_plugin->create_processor = - ProcessorPluginForwarder::forward_create_processor; - native_plugin->delete_processor = - ProcessorPluginForwarder::forward_delete_processor; - - return native_plugin; - } - - static void delete_plugin( - RTI_RoutingServiceProcessorPlugin *native_plugin, - RTI_RoutingServiceEnvironment *) - { - ProcessorPlugin *plugin = static_cast( - native_plugin->processor_plugin_data); - // Plug-in is destructor not allowed to throw - delete plugin; - RTIOsapiHeap_freeStructure(native_plugin); - } - - - static RTI_RoutingServiceProcessor * forward_create_processor( - void *native_plugin_data, - RTI_RoutingServiceRoute *native_route, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - return ProcessorForwarder::create_native( - static_cast(native_plugin_data), - native_route, - native_properties, - environment); - - } - - static void forward_delete_processor( - void *native_plugin_data, - struct RTI_RoutingServiceProcessor *native_processor, - RTI_RoutingServiceRoute *, - RTI_RoutingServiceEnvironment *environment) - { - - ProcessorForwarder::delete_native( - static_cast(native_plugin_data), - native_processor, - environment); - } - -}; - -}}}} - -#endif // RTI_ROUTING_PROCESSOR_PLUGIN_DETAIL_PROCESSOR_PLUGIN_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/Transformation.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/Transformation.hpp deleted file mode 100644 index 4971d46cf..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/Transformation.hpp +++ /dev/null @@ -1,223 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_TRANSF_TRANSFORMATION_HPP_ -#define RTI_ROUTING_TRANSF_TRANSFORMATION_HPP_ - -#include - -#include -#include -#include -#include - -namespace rti { namespace routing { namespace transf { - -/** @ingroup RTI_RoutingServiceTransformationModule - * - * @class rti::routing::transf::Transformation - * @brief Provides a way to transform input samples into output samples of a - * different format and/or content. - * - * @mtsafety Partially Safe - * All operations on a concrete Transformation object are safe and - * always serialized on a given Output. Operations on different - * Transformations objects may be called concurrently if they - * belong to different Outputs from different Routes. - */ -class Transformation : public UpdatableEntity{ -public: - - typedef void* SamplePtr; - typedef void* InfoPtr; - - /** - * @brief Transforms a vector of input samples into a vector of output - * samples. - * - * When @product is done using the output samples, it will 'return the loan' - * to the transformation by calling Transformation::return_loan. It is - * guaranteed @product takes one outstanding loan at time. - * - * The number of output samples can be different than the number of input - * samples. - * - * The format associated with the input and output data samples and info - * samples depends on the format provided and consumed by the input's - * rti::routing::adapter::StreamReader and the output's - * rti::routing::adapter::StreamWriter. - * - * For the built-in DDS adapter, the format of the samples is - * dds::core::xtypes::DynamicData and the format of the sample info is - * dds::sub::SampleInfo. - * - * @param output_sample_seq - * @rs_st_inout Vector that will hold the output data samples. @product - * provides this vector to the Transformation to fill. For each call, - * the size of the vector is zero. - * @param output_info_seq - * @rs_st_inout Vector that will hold the input info samples. @product - * provides this vector to the Transformation to fill. For each call, - * the size of the vector is zero. - * @param input_sample_seq - * @rs_st_in Vector of input data samples. This vector contains the list - * of samples that need to be transformed before calling - * rti::routing::adapter::StreamWriter::write. - * @param input_info_seq - * @rs_st_in Vector of input info sample. This vector contains the list - * of samples that need to be transformed before calling - * rti::routing::adapter::StreamWriter::write. - * - * @throw std::exception - */ - virtual void transform( - std::vector& output_sample_seq, - std::vector& output_info_seq, - const std::vector& input_sample_seq, - const std::vector& input_info_seq) = 0; - - /** - * @brief Returns a loan on the transformed data samples and info samples. - * - * @product calls this method to indicate that it is done accessing - * the collection of data samples and info samples obtained by an earlier - * invocation of Transformation::transform. - * - * @param sample_seq - * @rs_st_in Vector of loaned data samples. - * @param info_seq - * @rs_st_in Vector of loaned info samples. - * - * @throw std::exception - * - */ - virtual void return_loan( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - - virtual ~Transformation() {} -}; - - -/** @ingroup RTI_RoutingServiceTransformationModule - * - * @class rti::routing::transf::TypedTransformation - * - * @brief A wrapper implementation of a Transformation that provides a - * strongly-typed interface through template parameters for data and info - * representation. - * - * You can implement this interface as a convenience to manipulate the data - * and info representation without dealing with opaque pointers. - */ -template -class TypedTransformation : public Transformation { - -public: - - /** - * @brief The data type - */ - typedef Data DataRep; - /** - * @brief The info type - */ - typedef Info InfoRep; - - using Transformation::transform; - using Transformation::return_loan; - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - void transform( - std::vector& output_sample_seq, - std::vector& output_info_seq, - const std::vector& input_sample_seq, - const std::vector& input_info_seq) RTI_FINAL - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(in_sample_seq_, input_sample_seq); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(in_info_seq_, input_info_seq); - transform( - out_sample_seq_, - out_info_seq_, - in_sample_seq_, - in_info_seq_); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(output_sample_seq, out_sample_seq_); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(output_info_seq, out_info_seq_); - } - - /** - * @brief Performs the conversion between the vector of data and info - * pointers to strongly-type pointers. - */ - void return_loan( - std::vector& sample_seq, - std::vector& info_seq) RTI_FINAL - { - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(out_sample_seq_, sample_seq); - RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(out_info_seq_, info_seq); - return_loan(out_sample_seq_, out_info_seq_); - out_sample_seq_.clear(); - out_info_seq_.clear(); - } - - /** - * @brief Interface redefinition - * - * @see Transformation::transform - */ - virtual void transform( - std::vector& output_sample_seq, - std::vector& output_info_seq, - const std::vector& input_sample_seq, - const std::vector& input_info_seq) = 0; - - /** - * @brief Interface redefinition - * - * @see Transformation::return_loan - */ - virtual void return_loan( - std::vector& sample_seq, - std::vector& info_seq) = 0; - - /** - * @brief Virtual destructor - */ - virtual ~TypedTransformation() - { - - } -private: - std::vector in_sample_seq_; - std::vector in_info_seq_; - std::vector out_sample_seq_; - std::vector out_info_seq_; - -}; - -/** @ingroup RTI_RoutingServiceTransformationModule - * - * @brief Convenient definition of TypedTransformation that requires - * dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo - * for info samples. - * - */ -typedef TypedTransformation - DynamicDataTransformation; - - -}}} - - -#endif // RTI_ROUTING_TRANSF_TRANSFORMATION_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/TransformationPlugin.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/TransformationPlugin.hpp deleted file mode 100644 index 3581740f0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/TransformationPlugin.hpp +++ /dev/null @@ -1,221 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_TRANSF_TRANSFORMATION_PLUGIN_HPP_ -#define RTI_ROUTING_TRANSF_TRANSFORMATION_PLUGIN_HPP_ - -#include "routingservice/routingservice_log.h" - -#include -#include -#include -#include -#include - -/*e \file - @brief RTI Routing Service Transformation API -*/ -/** @defgroup RTI_RoutingServiceTransformationModule RTI Routing Service Transformation API - * @ingroup ROUTER - * @brief This module describes the Transformation API. - * - * An @product Output transforms the incoming data using a @em transformation, - * which is an object created by a transformation plugin.
- * - */ - -namespace rti { namespace routing { namespace transf { - -/** @ingroup RTI_RoutingServiceTransformationModule - * - * @class rti::routing::transf::TransformationPlugin - * - * @brief The top-level plug-in class. - * - * Represents a factory of Transformation. - */ -class TransformationPlugin { -public: - - /** - * @brief Creates an Output Transformation. - * - * This function is called when the Output containing the transformation - * is enabled. - * - * The format associated with the input and output types depends on - * the format provided by the input and output adapters. - * - * For the built-in DDS adapter, the format of the types is DDS_TypeCode. - * Required: yes - * - * @param input_type_info - * @rs_st_in Type information associated with the input samples. - * @param output_type_info - * @rs_st_in Type information associated with the output samples. - * @param properties - * @rs_st_in Configuration properties for the Transformation. - * These properties corresponds to the properties specified within - * the tag <transformation>. - * - * @return New Transformation if successful. Cannot return @null_value. - * @throw std::exception - * @mtsafety Safe - */ - virtual Transformation * create_transformation( - const rti::routing::TypeInfo& input_type_info, - const rti::routing::TypeInfo& output_type_info, - const rti::routing::PropertySet& properties) = 0; - - /** - * @brief Deletes a Transformation. - * - * This function is called when the Output containing the transformation is - * disabled. - * - * @param transformation - * @rs_st_in Transformation to be deleted. - * - * @throw std::exception - * @mtsafety Safe - */ - virtual void delete_transformation(Transformation *transformation) = 0; - - /** - * @return The version of this TransformationPlugin. - * - * Version is used for logging purposes and allows you to track which - * version of the TransformationPlugin @product is using. - * - * Default implementation of this operation returns the version of the - * required Connext libraries. - */ - virtual rti::config::LibraryVersion get_version() const - { - return rti::config::LibraryVersion(); - } - - /** - * @brief Virtual destructor - */ - virtual ~TransformationPlugin() {} -}; - -}}} - -#include - -/** @ingroup RTI_RoutingServiceTransformationModule - * - * @brief Utility macro that declares a native extern function that can - * be used to load a TransformationPlugin through a shared library. - * - * The prototype of the function is given by - * RTI_RoutingServiceTransformationPlugin_CreateFcn. - * - * To register a transformation plugin with @product, you must use the tag - * <transformation_plugin> within <plugin_library>. For example: - * - * \code - * - * ... - * - * - * mytransformation - * - * MyTransfPlugin_create - * - * - * ... - * - * ... - * - * ... - * - * ... - * - * \endcode - * - * Once a transformation plugin is registered, an Output can use it to create a - * data transformation. - * - * For example: - * - * \code - * - * - * Square - * ShapeType - * - * - * Square - * ShapeType - * - * - * - * - * X - * Y - * - * - * Y - * X - * - * - * - * - * - * - * \endcode - * - * For additional information on configuring transformations, see the - * \ref_url_routing_service_users_manual. - * - * @param TRANSFORMATION_PLUGIN_CLASS - * Class name of a TransformationPlugin implementation - */ -#define RTI_TRANSFORMATION_PLUGIN_CREATE_FUNCTION_DECL(TRANSFORMATION_PLUGIN_CLASS) \ -extern "C" RTI_USER_DLL_EXPORT struct RTI_RoutingServiceTransformationPlugin * \ - TRANSFORMATION_PLUGIN_CLASS ## _create_transformation_plugin(\ - const struct RTI_RoutingServiceProperties *, \ - RTI_RoutingServiceEnvironment *); \ - -/** @ingroup RTI_RoutingServiceTransformationModule - * - * @brief Utility macro that implements the TransformationPlugin entry point - * declared with RTI_TRANSFORMATION_PLUGIN_CREATE_FUNCTION_DECL. - */ -#define RTI_TRANSFORMATION_PLUGIN_CREATE_FUNCTION_DEF(TRANSFORMATION_PLUGIN_CLASS) \ -struct RTI_RoutingServiceTransformationPlugin * \ - TRANSFORMATION_PLUGIN_CLASS ## _create_transformation_plugin( \ - const struct RTI_RoutingServiceProperties * native_properties, \ - RTI_RoutingServiceEnvironment *environment) \ -{ \ - rti::routing::PropertySet properties; \ - rti::routing::PropertyAdapter::add_properties_from_native(\ - properties,\ - native_properties); \ - try { \ - return rti::routing::transf::detail::TransformationPluginForwarder::create_plugin(\ - new TRANSFORMATION_PLUGIN_CLASS(properties)); \ - } catch (const std::exception& ex) {\ - RTI_RoutingServiceEnvironment_set_error(\ - environment,\ - "%s",\ - ex.what());\ - } catch (...) {}\ - \ - return NULL; \ -} - - - - -#endif // RTI_ROUTING_TRANSF_TRANSFORMATION_PLUGIN_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationForwarder.hpp deleted file mode 100644 index 4290013a6..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationForwarder.hpp +++ /dev/null @@ -1,257 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_TRANSF_DETAIL_TRANSFORMATION_FORWARDER_HPP_ -#define RTI_ROUTING_TRANSF_DETAIL_TRANSFORMATION_FORWARDER_HPP_ - -#include - -#include -#include - -#include -#include -#include -#include - -#include "rti/apputils/ServiceException.hpp" - - -namespace rti { namespace routing { namespace transf { namespace detail { - - -class TransformationForwarder{ -public: - static RTI_RoutingServiceTransformation create_native( - TransformationPlugin *plugin, - const struct RTI_RoutingServiceTypeInfo *native_input_type_info, - const struct RTI_RoutingServiceTypeInfo *native_output_type_info, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - try { - using rti::routing::detail::ScopedForwarder; - - TypeInfo input_type_info(*native_input_type_info); - TypeInfo output_type_info(*native_output_type_info); - - std::map properties; - rti::routing::PropertyAdapter::add_properties_from_native( - properties, - native_properties); - - TransformationForwarder *forwarder = new TransformationForwarder(); - ScopedForwarder scoped( - plugin, - forwarder, - environment); - forwarder->transformation_ = plugin->create_transformation( - input_type_info, - output_type_info, - properties); - RTI_ROUTING_THROW_ON_NULL(forwarder->transformation_); - - scoped.release(); - return forwarder->native(); - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - return NULL; - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - return NULL; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return NULL; - } - - } - - static void delete_native( - TransformationPlugin *plugin, - RTI_RoutingServiceTransformation native_transformation, - RTI_RoutingServiceEnvironment *environment) - { - TransformationForwarder *forwarder = - static_cast(native_transformation); - try { - if (forwarder->transformation_ != NULL) { - plugin->delete_transformation( - forwarder->transformation_); - forwarder->transformation_ = NULL; - } - } catch(const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch(const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - delete forwarder; - } - - static void transform( - RTI_RoutingServiceTransformation native_transformation, - RTI_RoutingServiceSample **out_sample_lst, - RTI_RoutingServiceSampleInfo **out_info_lst, - int *out_count, - RTI_RoutingServiceSample *in_sample_lst, - RTI_RoutingServiceSampleInfo *in_info_lst, - int in_count, - RTI_RoutingServiceEnvironment *environment) - { - TransformationForwarder *forwarder = - static_cast (native_transformation); - if (forwarder->transformation_ == NULL) { - return; - } - - *out_count = 0; - try { - // get native samples - forwarder->in_sample_seq_.resize(in_count); - forwarder->in_info_seq_.resize(in_count); - for (int i = 0; i < in_count; i++) { - forwarder->in_sample_seq_[i] = in_sample_lst[i]; - if (in_info_lst != NULL) { - forwarder->in_info_seq_[i] = in_info_lst[i]; - } - } - - forwarder->transformation_->transform( - forwarder->out_sample_seq_, - forwarder->out_info_seq_, - forwarder->in_sample_seq_, - forwarder->in_info_seq_); - if (!forwarder->out_info_seq_.empty() - && (forwarder->out_info_seq_.size() - != forwarder->out_sample_seq_.size())) { - throw dds::core::PreconditionNotMetError( - "sample and info sequences length mismatch"); - } - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - return; - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - return; - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - return; - } - - // direct mapping - *out_count = static_cast(forwarder->out_sample_seq_.size()); - if (*out_count > 0) { - *out_sample_lst = &forwarder->out_sample_seq_[0]; - *out_info_lst = &forwarder->out_info_seq_[0]; - } - } - - static void return_loan( - RTI_RoutingServiceTransformation native_transformation, - RTI_RoutingServiceSample *, - RTI_RoutingServiceSampleInfo *, - int, - RTI_RoutingServiceEnvironment *environment) - { - TransformationForwarder *forwarder = - static_cast(native_transformation); - if (forwarder->transformation_ == NULL) { - return; - } - - try { - forwarder->transformation_->return_loan( - forwarder->out_sample_seq_, - forwarder->out_info_seq_); - } catch (const rti::apputils::FatalServiceException& ex) { - RTI_RoutingServiceEnvironment_fatal_error( - environment, - ex.what()); - } catch (const std::exception& ex) { - RTI_RoutingServiceEnvironment_set_error( - environment, - ex.what()); - } catch (...) { - RTI_RoutingServiceEnvironment_set_error( - environment, - "unexpected exception"); - } - - forwarder->out_sample_seq_.clear(); - forwarder->out_info_seq_.clear(); - - } - - static void update( - RTI_RoutingServiceTransformation native_stream_reader, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - - TransformationForwarder *stream_reader_forwarder = - static_cast (native_stream_reader); - - rti::routing::detail::UpdatableEntityForwarder::update( - stream_reader_forwarder->transformation_, - native_properties, - environment); - } - - RTI_RoutingServiceTransformation native() - { - return this; - } - - -private: - - TransformationForwarder() - : transformation_(NULL) - { - - } - - ~TransformationForwarder() - { - } - - -private: - - Transformation *transformation_; - std::vector out_sample_seq_; - std::vector out_info_seq_; - std::vector in_sample_seq_; - std::vector in_info_seq_; -}; - -}}}} - -#endif // RTI_ROUTING_TRANSF_DETAIL_TRANSFORMATION_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationPluginForwarder.hpp b/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationPluginForwarder.hpp deleted file mode 100644 index 9f328e8e0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/routing/transf/detail/TransformationPluginForwarder.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2017. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_ROUTING_TRANSF_DETAIL_TRANSFORMATION_PLUGIN_FORWARDER_HPP_ -#define RTI_ROUTING_TRANSF_DETAIL_TRANSFORMATION_PLUGIN_FORWARDER_HPP_ - -#include - -#include - -#include - -namespace rti { namespace routing { namespace transf { namespace detail { - - -class TransformationPluginForwarder { -public: - static RTI_RoutingServiceTransformationPlugin * create_plugin( - TransformationPlugin *transformation_plugin) - { - RTI_RoutingServiceTransformationPlugin *native_plugin = NULL; - RTIOsapiHeap_allocateStructure( - &native_plugin, - struct RTI_RoutingServiceTransformationPlugin); - rti::core::check_create_entity( - native_plugin, - "RTI_RoutingServiceTransformationPlugin"); - RTI_RoutingServiceTransformationPlugin_initialize(native_plugin); - - // Set adapter version - rti::config::LibraryVersion version = transformation_plugin->get_version(); - native_plugin->plugin_version.major = version.major_version(); - native_plugin->plugin_version.minor = version.minor_version(); - native_plugin->plugin_version.release = version.release_version(); - - // Initiallize adapter methods - native_plugin->user_object = static_cast(transformation_plugin); - native_plugin->transformation_plugin_delete = - TransformationPluginForwarder::delete_plugin; - native_plugin->transformation_plugin_create_transformation = - TransformationPluginForwarder::create_transformation; - native_plugin->transformation_plugin_delete_transformation = - TransformationPluginForwarder::delete_transformation; - native_plugin->transformation_transform = - TransformationForwarder::transform; - native_plugin->transformation_return_loan = - TransformationForwarder::return_loan; - native_plugin->transformation_update = - TransformationForwarder::update; - - return native_plugin; - } - - static void delete_plugin( - RTI_RoutingServiceTransformationPlugin *native_plugin, - RTI_RoutingServiceEnvironment *) - { - TransformationPlugin *plugin = static_cast( - native_plugin->user_object); - // Plug-in is destructor not allowed to throw - delete plugin; - RTIOsapiHeap_freeStructure(native_plugin); - } - - static RTI_RoutingServiceTransformation create_transformation( - struct RTI_RoutingServiceTransformationPlugin *native_plugin, - const struct RTI_RoutingServiceTypeInfo *input_type_info, - const struct RTI_RoutingServiceTypeInfo *output_type_info, - const struct RTI_RoutingServiceProperties *native_properties, - RTI_RoutingServiceEnvironment *environment) - { - return TransformationForwarder::create_native( - static_cast(native_plugin->user_object), - input_type_info, - output_type_info, - native_properties, - environment); - - } - - static void delete_transformation( - struct RTI_RoutingServiceTransformationPlugin *native_plugin, - RTI_RoutingServiceTransformation native_transformation, - RTI_RoutingServiceEnvironment *environment) - { - TransformationForwarder::delete_native( - static_cast(native_plugin->user_object), - native_transformation, - environment); - } - -}; - - -}}}} - -#endif // RTI_ROUTING_TRANSF_DETAIL_TRANSFORMATION_PLUGIN_FORWARDER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/webdds/Dll.hpp b/qt6-after/qt6-migrated-legatus/include/rti/webdds/Dll.hpp deleted file mode 100644 index 9ff38f2e0..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/webdds/Dll.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - * - * Description - * ----------- - * Strictly for Windows DLL linkage resolution - */ - - -#ifndef wsdds_dll_h -#define wsdds_dll_h - -#if defined(RTI_WIN32) || defined(RTI_WINCE) - #if defined(RTI_wsdds_DLL_EXPORT) - #define WSDDSDllExport __declspec(dllexport) - #else - #define WSDDSDllExport - #endif /* RTI_wsdds_DLL_EXPORT */ - - #if defined(RTI_wsdds_DLL_VARIABLE) - #if defined(RTI_wsdds_DLL_EXPORT) - #define WSDDSDllVariable __declspec(dllexport) - #else - #define WSDDSDllVariable __declspec(dllimport) - #endif /* RTI_wsdds_DLL_EXPORT */ - #else - #define WSDDSDllVariable - #endif /* RTI_wsdds_DLL_VARIABLE */ -#elif defined(RTI_VISIBILITY_HIDDEN) - #define WSDDSDllExport __attribute__((visibility("default"))) - #define WSDDSDllVariable __attribute__((visibility("default"))) -#else - #define WSDDSDllExport - #define WSDDSDllVariable -#endif /* RTI_WIN32 || RTI_WINCE */ - - -#endif /* webintegrationservice_dll_h */ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/webdds/Service.hpp b/qt6-after/qt6-migrated-legatus/include/rti/webdds/Service.hpp deleted file mode 100644 index 4a5795e4b..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/webdds/Service.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef WEBINTEGRATIONSERVICE_H -#define WEBINTEGRATIONSERVICE_H - -#include -#include - -#include -#include -#include - -namespace rti { namespace webdds { - -/*e \defgroup RTI_WebIntegrationServiceLibModule RTI Web Integration Library API - * - * @brief @product can be deployed as a native library linked into your - * application in select architectures. - * - * This API allows you to create, configure and start @product instances from - * your application. - * - * The following code shows the typical use of the API: - * - * \code - * - * int main () - * { - * rti::webdds::Service service( - * rti::webdds::ServiceProperty() - * .cfg_file("MyWebint.xml") - * .cfg_name("MyWebint")); - * ... - * - * service.start(); - * - * while(keep_running) { - * sleep(); - * ... - * } - * - * return 0; - * } - * - * \endcode - * - * Instead of a file, you can use XML strings to configure @product. - * See ServiceProperty for more information. - *

- * To build your application you need to link with the @product native library - * in <@ndds home>/bin/<architecture>/ . - * - * ### Development Requirements - * - * | | Unix-based Systems | Windows Systems | - * | --------------: | :----------------: | :-------------: | - * | Shared Libraries| librtiwebintegrationservice.so | rtiwebintegrationservice.dll| - * | ^ | libnddscpp.so | nddscpp.dll | - * | ^ | libnddsc.so | nddsc.dll | - * | ^ | libnddscore.so | nddscore.dll | - * | ^ | librtiapputilsc.so | rtiapputilsc.dll | - * | ^ | librtisqlite.so | rtisqlite.dll | - * | ^ | libcivetweb-cpp.so.1.15.0 | civetweb-cpp.dll | - * | ^ | libcivetweb.so.1.15.0 | civetweb.dll | - * | Headers | rti/webdds/Service.hpp | rti/webdds/Service.hpp | - * - */ - - -/** \ingroup RTI_WebIntegrationServiceLibModule - * - * @brief The @product. - * - */ -class Service : public dds::core::Reference { -public: - typedef dds::core::Reference Base; - OMG_DDS_REF_TYPE_NOTYPENAME( - Service, - dds::core::Reference, - WebIntegrationServiceImpl); - - /** - * @brief Creates a @product instance - * - * @param[in] property - * The property to configure @product instance. - * - */ - Service(ServiceProperty&& property) - : Base(new WebIntegrationServiceImpl(std::move(property))) - { - this->delegate()->remember_reference(this->delegate()); - } - - explicit Service(Base::DELEGATE_REF_T reference) : Base(reference) - { - if (this->delegate()) { - this->delegate()->remember_reference(this->delegate()); - } - } - - /** - * @brief Starts @product. - * - * This is a non-blocking operation. @product will create its own set of - * threads to perform its tasks. - */ - void start() - { - this->delegate()->start(); - } - - /** - * @brief Stops @product. - * - * This operation will bloc the instance is fully stopped. - */ - void stop() - { - this->delegate()->stop(); - } - -}; - -}} - -#endif // WEBINTEGRATIONSERVICE_H \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/include/rti/webdds/ServiceProperty.hpp b/qt6-after/qt6-migrated-legatus/include/rti/webdds/ServiceProperty.hpp deleted file mode 100644 index cf383205c..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/webdds/ServiceProperty.hpp +++ /dev/null @@ -1,341 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2022. - * All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef SERVICE_PROPERTY_H -#define SERVICE_PROPERTY_H - -#define SERVICE_DEFAULT_VERBOSITY 1 -#define WEBSERVER_DEFAULT_PORT_STR "8080" - -#include -#include - -#include - -namespace rti { namespace webdds { - -// Forward declaration -class AccessController; -class LoggerDevice; - -/** - * \ingroup RTI_WebIntegrationServiceLibModule - * - * @brief Configuration properties for a @product object. - */ -class WSDDSDllExport ServiceProperty { -public: - /** - * @brief Construct a new Service Property object - * - */ - ServiceProperty(); - - ServiceProperty(const ServiceProperty&) = delete; - ServiceProperty& operator=(const ServiceProperty&) = delete; - ServiceProperty(ServiceProperty&&) = default; - ServiceProperty& operator=(ServiceProperty&&) = default; - - /** - * @brief Destroy the Service Property object - * - */ - ~ServiceProperty(); - - /** - * @brief Set it to true to enable the Builtin Topics REST API. - * - * Allows clients to read discovery information through the Builtin Topics. - * - * @default false - */ - ServiceProperty& enable_builtin_topics(bool value); - - /** - * @brief Getter (see setter with the same name). - */ - bool enable_builtin_topics() const; - - - /** - * @brief Set it to true to enable the WebSockets REST API. - * - * Allows clients to read/write data through WebSockets. - * - * @default false - */ - ServiceProperty& enable_websockets(bool value); - - /** - * @brief Getter (see setter with the same name). - */ - bool enable_websockets() const; - - /** - * @brief Getter (see setter with the same name). - */ - bool list_api_keys() const; - - /** - * @brief Caches entities thread-specific storage. - * - * Caches WaitSet, Sample Buffer, and DynamicData objects in the - * thread-specific storage of the worker threads that handle HTTP requests. - * - * You can limit the allocated resources by reducing the number of worker - * threads via the set_webserver_option() method and setting the option - * "num_threads" - * - * @default false - */ - ServiceProperty& enable_resource_caching(bool value); - - /** - * @brief Getter (see setter with the same name). - */ - bool enable_resource_caching() const; - - /** - * @brief Enables the use of a custom logger. - * - * @default false - */ - ServiceProperty& use_custom_logger(bool value); - - /** - * @brief Getter (see setter with the same name). - */ - bool use_custom_logger() const; - - /*i - * @brief Set the Access Control List. - * - * @default nullptr - */ - ServiceProperty& acl(std::unique_ptr acl); - - /*i - * @brief Getter (see setter with the same name). - */ - AccessController *acl() const; - - /*i - * This method enters a key-value pair into the webserver_options_ array. - * - * @param key Name of the option to be set. - * @param value Value of the option. - */ - ServiceProperty& webserver_option( - const std::string& option, - const std::string& value); - - /** - * @brief Get the value of the webserver option. - * - * @param option Option name of the value to get. - * @return Pointer to the value if it exists. nullptr otherwise. - */ - const std::string *webserver_option(const std::string& option) const; - - /** - * @brief This method return the webserver_options_ array. - * the values are used as pairs of key-value each 2 values. - * - * @return const std::vector& - */ - const std::vector& webserver_options() const; - - /** - * @brief Specifies a configuration file to be loaded. - * - * @default Empty string - */ - ServiceProperty& cfgfile(const std::string& cfgfile); - - /** - * @brief Getter (see setter with the same name). - */ - const std::string& cfgfile() const; - - /** - * @brief The name of the RTI Web Integration Service configuration to run. - * - * Web Integration Service will look for a matching - * \ tag in the configuration file specified via - * the cfg_file() method and in the default configuration files. - * - * @default Empty string - */ - ServiceProperty& cfgname(const std::string& cfgname); - - /** - * @brief Getter (see setter with the same name). - */ - const std::string& cfgname() const; - - /** - * @brief The name of the Access Control List file. - * - * This parameter loads an Access Control List file, which enables access - * control in all the HTTP requests and WebSocket (WS) connections. It is - * recommended to use this parameter with a secured connection; i.e., it is - * important to enable HTTPS and Secure WebSocket (WSS) in every single - * listening_ports and provide an -sslCertificate. - * - * @default Empty string - */ - ServiceProperty& acl_file(const std::string& acl_file); - - /** - * @brief Getter (see setter with the same name). - */ - const std::string& acl_file() const; - - /** - * @brief Add a new api key to the list of api keys. - * - * @default Empty string - */ - ServiceProperty& create_api_key(const std::string& api_key); - - /** - * @brief Getter (see setter with the same name). - */ - const std::string& create_api_key() const; - - /** - * @brief Set it to true to list all the API keys available in an Access - * Control List file. - * - * This method must be used in combination with the acl_file method to - * specify the file from which API keys should be listed. - * - * @default false - */ - ServiceProperty& list_api_keys(bool value); - - /** - * @brief Delete an api key from the list of api keys. - * - * @default Empty string - */ - ServiceProperty& delete_api_key(const std::string& api_key); - - /** - * @brief Getter (see setter with the same name). - */ - const std::string& delete_api_key() const; - - /*i - * @brief Set the verbosity level param, must be used with - * setup_verbosity_level() to apply the passed value. - */ - ServiceProperty& param_verbosity(int verbosity); - - /*i - * @brief Getter (see setter with the same name). - */ - int param_verbosity(); - - /*i - * @brief Getter (see setter with the same name). - */ - int dds_verbosity(); - - /*i - * @brief Getter (see setter with the same name). - */ - int wsdds_verbosity(); - - /** - * @brief Use this attribute to increase the maximum number of objects per - * thread of RTI Data Distribution Service. - * - * @default 1024 - */ - - ServiceProperty& max_objects_per_thread(int max_objects_per_thread); - - /** - * @brief Getter (see setter with the same name). - */ - int max_objects_per_thread(); - - /** - * @brief Controls what type of messages are logged. - * - * The available levels are: - * - * 0. Silent - * 1. Exceptions (Connext DDS and Web Integration Service) - * 2. Warnings (Web Integration Service) - * 3. Information (Web Integration Service) - * 4. Warnings (Connext DDS and Web Integration Service) - * 5. Tracing (Web Integration Service) - * 6. Tracing (Connext DDS and Web Integration Service) - * - * Each verbosity level includes all the previous levels. - * - * @default false - */ - ServiceProperty& setup_verbosity_level(int verbosity_level); - - /** - * @brief Set the up verbosity level that is in verbosity_ atributte. - */ - - ServiceProperty& setup_verbosity_level(); - - - /** - * This method installs the custom logger, which enables the user to - * store logging messages in the thread-specific storage to be able to - * send them in HTTP responses. - */ - void install_logger(); - - /** - * This method uninstalls the custom logger. - */ - void uninstall_logger(); - -private: - // Arguments flags - bool list_api_keys_; - bool enable_resource_caching_; - bool enable_builtin_topics_; - bool enable_websockets_; - - // DDS Options - std::string cfgfile_; - std::string cfgname_; - std::string acl_file_; - std::string create_api_key_; - std::string delete_api_key_; - std::string heap_snapshot_dir_; - int verbosity_; - int dds_verbosity_; - int wsdds_verbosity_; - int max_objects_per_thread_; - - // WebServer options - std::vector webserver_options_; - - // Logger device - bool use_custom_logger_; - std::unique_ptr logger_device_; - - // Access Controller - std::unique_ptr acl_; -}; - -}} // namespace rti::webdds - -#endif // SERVICE_PROPERTY_H diff --git a/qt6-after/qt6-migrated-legatus/include/rti/webdds/detail/WebIntegrationServiceImpl.hpp b/qt6-after/qt6-migrated-legatus/include/rti/webdds/detail/WebIntegrationServiceImpl.hpp deleted file mode 100644 index 370b2e8fa..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/webdds/detail/WebIntegrationServiceImpl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * (c) Copyright, Real-Time Innovations, 2021. All rights reserved. - * - * No duplications, whole or partial, manual or electronic, may be made - * without express written permission. Any such copies, or - * revisions thereof, must display this notice unaltered. - * This code contains trade secrets of Real-Time Innovations, Inc. - */ - -#ifndef RTI_WSDDS_WEB_INTEGRATION_SERVICE_IMPL_HPP_ -#define RTI_WSDDS_WEB_INTEGRATION_SERVICE_IMPL_HPP_ - -#include -#include -#include - -#include - -#include - -namespace rti { namespace webdds { - -namespace service { -class Service; -} - -class WSDDSDllExport WebIntegrationServiceImpl - : public rti::core::detail::RetainableType -{ -public: - explicit WebIntegrationServiceImpl(ServiceProperty&& property); - - ~WebIntegrationServiceImpl(); - - void start(); - - void stop(); - -private: - std::unique_ptr impl_; -}; - -}} - -#endif // RTI_WSDDS_WEB_INTEGRATION_SERVICE_IMPL_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/xcdr/Interpreter.hpp b/qt6-after/qt6-migrated-legatus/include/rti/xcdr/Interpreter.hpp deleted file mode 100644 index 4b2a5284c..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/xcdr/Interpreter.hpp +++ /dev/null @@ -1,259 +0,0 @@ -/* $Id$ - -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. - -============================================================================= */ - -#ifndef RTI_XCDR_INTERPRETER_HPP_ -#define RTI_XCDR_INTERPRETER_HPP_ - -#include "xcdr/xcdr_interpreter.h" - - -namespace rti { namespace xcdr { - -/*i - * Provides the type code of a type. - * - * This struct is to be specialized in generated code for each TopicType. - * Specializations must define a static member function: - * RTIXCdrTypeCode * get() - */ -template -struct type_code; - -namespace detail { - -template -bool has_cpp_friendly_cdr_layout_impl() -{ - RTIXCdrUnsignedLongLong size; - RTIXCdrAlignment alignment; - RTIXCdrXTypesComplianceMask xTypesComplianceMask; - - xTypesComplianceMask = RTIXCdrInterpreter_getGlobalXtypeComplianceMask(); - - return RTIXCdrTypeCode_hasCFriendlyCdrLayout( - type_code::get(), - &size, - &alignment, - /* - * The number of element is not important; it's only important to - * know if there's one or more than one - */ - IsCollection ? 2 : 1, - RTI_XCDR_TRUE, /* v2Encapsulation */ - RTIXCdrXTypesComplianceMask_isBitSet( - xTypesComplianceMask, - RTI_XCDR_XTYPES_DHEADER_IN_NON_PRIMITIVE_COLLECTIONS_BIT), - RTIXCdrXTypesComplianceMask_isBitSet( - xTypesComplianceMask, - RTI_XCDR_XTYPES_ENUM_AS_PRIMITIVE_IN_COLLECTIONS_BIT)); -} - -} - -template -bool has_cpp_friendly_cdr_layout() -{ - static bool result = - detail::has_cpp_friendly_cdr_layout_impl(); - return result; -} - -template -bool has_cpp_friendly_cdr_layout_collection() -{ - static bool result = - detail::has_cpp_friendly_cdr_layout_impl(); - return result; -} - -struct NoOpPropertyConfigurator { - static void configure(RTIXCdrInterpreterProgramsGenProperty&) - { - // In general (trad. and micro C++), no additional properties. - // - // dds_cpp.2.0 defines a custom Configurator - // - } -}; - -/*i - * @brief Programs singleton for the to/from cdr functions - * - * The combination of the ProgramSingleton template parameters builds a single - * instance for the given type, program kinds and options. - * This will typically be instantiated in IDL-generated code. - * - * @tparam TopicType The topic-type these programs operate with - * @tparam ProgramKind A mask of the different programs to be generated - * @tparam ResolveAlias Value for RTIXCdrInterpreterProgramsGenProperty::resolveAlias - * when creating the programs - * @tparam InlineStruct Value for RTIXCdrInterpreterProgramsGenProperty::inlineStruct - * when creating the programs - * @tparam OptimizeEnum Value for RTIXCdrInterpreterProgramsGenProperty::optimizeEnum - * when creating the programs - * @tparam KeysOnly (default false) Whether to generate programs only for key fields - * @tparam PropertyConfigurator (default no-op) A functor that configures - * additional RTIXCdrInterpreterProgramsGenProperty to generate the - * programs. - * - * get_instance() creates the singleton the first time it's called. The singleton - * is automatically deleted by the destructor of a static local variable. - */ -template < - typename TopicType, - int ProgramKind, - bool ResolveAlias, - bool InlineStruct, - bool OptimizeEnum, - bool KeysOnly = false, - typename PropertyConfigurator = NoOpPropertyConfigurator> -struct ProgramsSingleton { -private: - ProgramsSingleton() - { - RTIXCdrInterpreterProgramsGenProperty property = - RTIXCdrInterpreterProgramsGenProperty_INITIALIZER; - - configure_property(property); - - programs_ = RTIXCdrInterpreterPrograms_new( - type_code::get(), - &property, - ProgramKind); - } - - ~ProgramsSingleton() - { - if (programs_ != NULL) { - RTIXCdrInterpreterPrograms_delete(programs_); - } - } - - static void configure_property( - RTIXCdrInterpreterProgramsGenProperty& property) - { - property.generateWithAllFields = - KeysOnly ? RTI_XCDR_FALSE : RTI_XCDR_TRUE; - property.resolveAlias = ResolveAlias ? RTI_XCDR_TRUE : RTI_XCDR_FALSE; - property.inlineStruct = InlineStruct ? RTI_XCDR_TRUE : RTI_XCDR_FALSE; - property.optimizeEnum = OptimizeEnum ? RTI_XCDR_TRUE : RTI_XCDR_FALSE; - PropertyConfigurator::configure(property); - } - - RTIXCdrInterpreterPrograms *programs_; - -public: - // Returns the singleton instance. It can be NULL if the program creation - // failed. - static RTIXCdrInterpreterPrograms * get_instance() - { - static ProgramsSingleton< - TopicType, - ProgramKind, - ResolveAlias, - InlineStruct, - OptimizeEnum, - KeysOnly, - PropertyConfigurator> instance; - return instance.programs_; - } - - // Creates the programs returned by get_instance() again for this singleton. - // This is required in testing when the global interpreter properties are - // modified from test to test. - static RTIXCdrInterpreterPrograms *regenerate_programs() - { - RTIXCdrInterpreterPrograms *programs = get_instance(); - if (programs == NULL) { - return NULL; - } - - RTIXCdrInterpreterProgramsGenProperty property = - RTIXCdrInterpreterProgramsGenProperty_INITIALIZER; - configure_property(property); - - // finalize and re-initialize the programs. Note that get_instance() - // will continue returning the same object, but internally it's been - // re-initialized. - RTIXCdrInterpreterPrograms_finalize(programs); - if (!RTIXCdrInterpreterPrograms_initialize( - programs, - type_code::get(), - &property, - ProgramKind)) { - return NULL; - } - - return programs; - } - -}; - -// Returns a ProgramsSingleton with the programs that the generated -// to/from cdr functions need -template < - typename TopicType, - bool ResolveAlias, - bool InlineStruct, - bool OptimizeEnum, - typename PropertyConfigurator> -RTIXCdrInterpreterPrograms * get_cdr_serialization_programs_w_property_configurator() -{ - return ProgramsSingleton< - TopicType, - RTI_XCDR_SER_PROGRAM - | RTI_XCDR_DESER_PROGRAM - | RTI_XCDR_GET_SER_SIZE_PROGRAM - | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM, - ResolveAlias, - InlineStruct, - OptimizeEnum, - false, - PropertyConfigurator>::get_instance(); -} - -template < - typename TopicType, - bool ResolveAlias, - bool InlineStruct, - bool OptimizeEnum> -RTIXCdrInterpreterPrograms * get_cdr_serialization_programs() -{ - return ProgramsSingleton< - TopicType, - RTI_XCDR_SER_PROGRAM - | RTI_XCDR_DESER_PROGRAM - | RTI_XCDR_GET_SER_SIZE_PROGRAM - | RTI_XCDR_GET_MAX_SER_SIZE_PROGRAM, - ResolveAlias, - InlineStruct, - OptimizeEnum, - false, - NoOpPropertyConfigurator>::get_instance(); -} - -/*i - * Provides the interpreter programs for a type. (Currently it only provides - * the initialize_sample program used to initialize FlatData samples) - * - * This struct is to be specialized in generated code for each TopicType. - * Specializations must define a static member function: - * RTIXCdrInterpreterPrograms * get(), which will call - * get_cdr_initialization_programs() with the options (ResolveAlias, etc.) used - * to generate code for this type. - */ -template -struct type_programs; - -} } // namespace rti::xcdr - -#endif // RTI_XCDR_INTERPRETER_HPP_ diff --git a/qt6-after/qt6-migrated-legatus/include/rti/xcdr/Stream.hpp b/qt6-after/qt6-migrated-legatus/include/rti/xcdr/Stream.hpp deleted file mode 100644 index 187153539..000000000 --- a/qt6-after/qt6-migrated-legatus/include/rti/xcdr/Stream.hpp +++ /dev/null @@ -1,429 +0,0 @@ -/* $Id$ - -(c) Copyright, Real-Time Innovations, 2018. -All rights reserved. - -No duplications, whole or partial, manual or electronic, may be made -without express written permission. Any such copies, or -revisions thereof, must display this notice unaltered. -This code contains trade secrets of Real-Time Innovations, Inc. - -============================================================================= */ - -#ifndef RTI_XCDR_STREAM_HPP_ -#define RTI_XCDR_STREAM_HPP_ - -#include "xcdr/xcdr_stream.h" - -namespace rti { namespace xcdr { - - -#define RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_BODY(\ - TYPE,\ - CDR_TYPE,\ - SERIALIZE_MACRO)\ - static void serialize_fast(RTIXCdrStream *stream, const TYPE* v)\ - {\ - RTIXCdrStream_ ## SERIALIZE_MACRO ## ByteFast(stream, (CDR_TYPE *) v);\ - }\ - static void deserialize_fast(RTIXCdrStream *stream, TYPE* v)\ - {\ - RTIXCdrStream_de ## SERIALIZE_MACRO ## ByteFast(stream, (CDR_TYPE *) v);\ - }\ - static bool serialize(RTIXCdrStream *stream, const TYPE* v)\ - {\ - return RTIXCdrStream_ ## SERIALIZE_MACRO ## Byte(stream, (CDR_TYPE *) v, RTI_XCDR_TRUE);\ - }\ - static bool deserialize(RTIXCdrStream *stream, TYPE* v)\ - {\ - return RTIXCdrStream_de ## SERIALIZE_MACRO ## Byte(stream, (CDR_TYPE *) v, RTI_XCDR_TRUE);\ - }\ - -#define RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - TYPE,\ - CDR_TYPE,\ - SERIALIZE_MACRO)\ -template <>\ -struct primitive_type_traits {\ -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_BODY(TYPE, CDR_TYPE, SERIALIZE_MACRO)\ -} - -#define RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_W_ALIGNMENT_PARAM(\ - TYPE,\ - CDR_TYPE,\ - SERIALIZE_MACRO,\ - ALIGNMENT)\ -template <>\ -struct primitive_type_traits {\ - static void serialize_fast(RTIXCdrStream *stream, const TYPE* v)\ - {\ - RTIXCdrStream_ ## SERIALIZE_MACRO ## ByteFast(stream, (CDR_TYPE *) v);\ - }\ - static void deserialize_fast(RTIXCdrStream *stream, TYPE* v)\ - {\ - RTIXCdrStream_de ## SERIALIZE_MACRO ## ByteFast(stream, (CDR_TYPE *) v);\ - }\ - static bool serialize(RTIXCdrStream *stream, const TYPE* v)\ - {\ - return RTIXCdrStream_ ## SERIALIZE_MACRO ## Byte(stream, (CDR_TYPE *) v, RTI_XCDR_TRUE, ALIGNMENT);\ - }\ - static bool deserialize(RTIXCdrStream *stream, TYPE* v)\ - {\ - return RTIXCdrStream_de ## SERIALIZE_MACRO ## Byte(stream, (CDR_TYPE *) v, RTI_XCDR_TRUE, ALIGNMENT);\ - }\ -} - -#define RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_NO_ALIGN_PARAM(\ - TYPE,\ - CDR_TYPE,\ - SERIALIZE_MACRO)\ -template <>\ -struct primitive_type_traits {\ - static void serialize_fast(RTIXCdrStream *stream, const TYPE* v)\ - {\ - RTIXCdrStream_ ## SERIALIZE_MACRO ## ByteFast(stream, (CDR_TYPE *) v);\ - }\ - static void deserialize_fast(RTIXCdrStream *stream, TYPE* v)\ - {\ - RTIXCdrStream_de ## SERIALIZE_MACRO ## ByteFast(stream, (CDR_TYPE *) v);\ - }\ - static bool serialize(RTIXCdrStream *stream, const TYPE* v)\ - {\ - return RTIXCdrStream_ ## SERIALIZE_MACRO ## Byte(stream, (CDR_TYPE *) v);\ - }\ - static bool deserialize(RTIXCdrStream *stream, TYPE* v)\ - {\ - return RTIXCdrStream_de ## SERIALIZE_MACRO ## Byte(stream, (CDR_TYPE *) v);\ - }\ -} - -// Base case handles T as an 4-byte integer (this is necessary for traditional -// C++ enums as well as C++11 enum classes) -template -struct primitive_type_traits { - RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_BODY(T, RTIXCdr4Byte, serialize4) -}; - -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_NO_ALIGN_PARAM(\ - char, RTIXCdr1Byte, serialize1); - -// The API can work with fixed-width integers (dds_cpp.2.0) or -// RTI-defined integers (dds_cpp.1.0). We need to make this distinction because -// on some platforms these types may not be exactly the same as far as template -// resolution. That is, compilers may or may not pick the template -// specialization for int32_t for an instantiation with int. -// -// If we define only one (e.g. int32_t) some compilers won't find a suitable -// definition for int. If we define both, some compilers will find duplicate -// definitions for int/int32_t. -#if !defined(RTI_AVOID_FIXED_WIDTH_INTEGERS) -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_NO_ALIGN_PARAM(\ - uint8_t, RTIXCdr1Byte, serialize1); - -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - int16_t, RTIXCdr2Byte, serialize2); -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - uint16_t, RTIXCdr2Byte, serialize2); - -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - int32_t, RTIXCdr4Byte, serialize4); -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - uint32_t, RTIXCdr4Byte, serialize4); - -typedef uint32_t length_t; -#else -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_NO_ALIGN_PARAM(\ - unsigned char, RTIXCdr1Byte, serialize1); - -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - short, RTIXCdr2Byte, serialize2); -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - unsigned short, RTIXCdr2Byte, serialize2); - -// int and unsigned int, as well as enum are handled by the general case - -typedef unsigned int length_t; -#endif - -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS(\ - float, RTIXCdr4Byte, serialize4); - -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_W_ALIGNMENT_PARAM(\ - DDS_LongLong, RTIXCdr8Byte, serialize8, 4); - -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_W_ALIGNMENT_PARAM(\ - DDS_UnsignedLongLong, RTIXCdr8Byte, serialize8, 4); -RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS_W_ALIGNMENT_PARAM(\ - double, RTIXCdr8Byte, serialize8, 4); - -// RTI_XCDR_SPECIALIZE_PRIMITIVE_TYPE_TRAITS( -// rti::core::LongDouble, RTI_CDR_LONG_DOUBLE_TYPE, RTIXCdr16Byte, serialize16Byte); - -template -void serialize_fast(RTIXCdrStream& stream, const T& value) -{ - primitive_type_traits::serialize_fast(&stream, &value); -} - -template -void deserialize_fast(RTIXCdrStream& stream, T& value) -{ - primitive_type_traits::deserialize_fast(&stream, &value); -} - -class Stream { -public: - Stream() - { - RTIXCdrStream_init(&stream_); - RTIXCdrStream_set(&stream_, NULL, 0); - - stream_._tmpRelativeBuffer = NULL; - stream_._needByteSwap = 0; - stream_._endian = stream_._nativeEndian; - stream_._encapsulationKind = 0; - stream_._encapsulationOptions = 0; - } - - explicit Stream(const RTIXCdrStream& c_stream) - { - stream_ = c_stream; // shallow assign - } - - // Creates a new stream that shares the same buffer and current position - // as another Stream - Stream(const Stream& other) - { - stream_ = other.stream_; // shallow assign - } - - // Creates a new Stream from an existing already-initialized buffer, whose - // encapsulation has already been set - Stream( - unsigned char *buffer, - length_t size, - length_t offset) - { - RTIXCdrFlatData_initializeStream( - &stream_, - buffer, - offset, - size); - } - - Stream& operator=(const Stream& other) - { - stream_ = other.stream_; // shallow assign (see copy constructor) - return *this; - } - - bool skip(length_t size) - { - if (!check_size(size)) { - return false; - } - RTIXCdrStream_increaseCurrentPosition(&stream_, size); - return true; - } - - void skip_fast(length_t size) - { - RTIXCdrStream_increaseCurrentPosition(&stream_, size); - } - - void skip_back(length_t bytes) - { - RTIXCdrStream_increaseCurrentPosition( - &stream_, - -static_cast(bytes)); - } - - unsigned char * buffer() - { - return reinterpret_cast(stream_._buffer); - } - - const unsigned char * buffer() const - { - return reinterpret_cast(stream_._buffer); - } - - unsigned char * current_position() - { - return reinterpret_cast( - RTIXCdrStream_getCurrentPosition(&stream_)); - } - - void current_position(unsigned char * pos) - { - RTIXCdrStream_setCurrentPosition( - &stream_, - reinterpret_cast(pos)); - } - - length_t used_size() const - { - return static_cast( - RTIXCdrStream_getCurrentPosition(&stream_) - stream_._buffer); - } - - length_t remaining_size() const - { - return total_size() - used_size(); - } - - length_t total_size() const - { - return stream_._bufferLength; - } - - bool needs_byte_swap() const - { - return stream_._needByteSwap == RTI_XCDR_TRUE; - } - - template - bool serialize(T value) - { - return primitive_type_traits::serialize(&stream_, &value); - } - - template - void serialize_fast(T value) - { - primitive_type_traits::serialize_fast(&stream_, &value); - } - - template - bool serialize_no_align(T value) - { - if (!check_size(sizeof(T))) { - return false; - } - primitive_type_traits::serialize_fast(&stream_, &value); - return true; - } - - template - T deserialize_fast() - { - T value; - primitive_type_traits::deserialize_fast(&stream_, &value); - return value; - } - - void serialize_fast(const void *array, length_t bytes) - { - RTIXCdrStream_serializeNByteFast(&stream_, array, bytes); - } - - char * serialize_dheader() - { - return RTIXCdrStream_serializeDHeader(&stream_); - } - - bool finish_dheader(char *dheader_position) - { - return RTIXCdrStream_serializeDHeaderLength(&stream_, dheader_position) - == RTI_XCDR_TRUE; - } - - bool serialize_emheader( - char*& position, - RTIXCdrUnsignedLong parameter_id, - RTIXCdrUnsignedLong lc, - bool must_understand = false) - { - RTIXCdrBoolean failure = 0; - position = RTIXCdrStream_serializeV2ParameterHeader( - &stream_, - &failure, - parameter_id, - must_understand ? RTI_XCDR_TRUE : RTI_XCDR_FALSE, - lc); - - return failure == RTI_XCDR_FALSE; - } - - void finish_emheader(char * emheader_position) - { - RTIXCdrStream_finishV2ParameterHeader(&stream_, emheader_position); - } - - bool align(unsigned int alignment) - { - return RTIXCdrStream_align(&stream_, (RTIXCdrAlignment) alignment) - == RTI_XCDR_TRUE; - } - - bool check_size(length_t size) const - { - bool result = RTIXCdrStream_checkSize(&stream_, size) == RTI_XCDR_TRUE; - return result; - } - - bool need_byte_swap() const - { - return stream_._needByteSwap != 0; - } - - RTIXCdrStream& c_stream() - { - return stream_; - } - - - // Saves the current position of a stream so it can be restored later on if - // needed. This utility has two main uses: - // - For Offsets: move the offset to a member, then go back - // - For Builders: allow rolling back to the state before starting building - // a member, in case of an error or a call to the builder's discard() - // - // For maintainability we also save the relativeBuffer, but FlatData doesn't - // use it. - class Memento { - public: - explicit Memento(Stream& stream) : - stream_(stream), - original_position_(stream.current_position()), - relative_buffer_(stream.c_stream()._relativeBuffer) - { - } - - // Restores the saved position unless discard() has been called - ~Memento() - { - restore(); - } - - // Restores the saved position unless discard() has been called - void restore() - { - if (original_position_ != NULL) { - stream_.current_position(original_position_); - stream_.c_stream()._relativeBuffer = relative_buffer_; - } - } - - // Call this to no longer restore the original position - unsigned char * discard() - { - unsigned char *pos = original_position_; - original_position_ = NULL; - return pos; - } - - private: - Stream& stream_; - unsigned char *original_position_; - char *relative_buffer_; - }; - - -private: - RTIXCdrStream stream_; -}; - -} } // namespace rti::xcdr - -#endif // RTI_XCDR_STREAM_HPP_